about summary refs log tree commit diff
path: root/docs/dev/debugging.md
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-08-09 16:06:49 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2021-08-09 16:15:02 +0300
commit3e5b15571632467f203c3f93d0b56f41d0fb64f5 (patch)
tree5e854c8c367f3539dbd0c0d2c97c0861e657374e /docs/dev/debugging.md
parent9aa6be71a53fd55d8e0a15254b329aab6a5bcb9a (diff)
fix: avoid pathological macro expansions
Today, rust-analyzer (and rustc, and bat, and IntelliJ) fail badly on
some kinds of maliciously constructed code, like a deep sequence of
nested parenthesis.

"Who writes 100k nested parenthesis" you'd ask?

Well, in a language with macros, a run-away macro expansion might do
that (see the added tests)! Such expansion can be broad, rather than
deep, so it bypasses recursion check at the macro-expansion layer, but
triggers deep recursion in parser.

In the ideal world, the parser would just handle deeply nested structs
gracefully. We'll get there some day, but at the moment, let's try to be
simple, and just avoid expanding macros with unbalanced parenthesis in
the first place.

closes #9358
Diffstat (limited to 'docs/dev/debugging.md')
0 files changed, 0 insertions, 0 deletions