10000 levels of reference indirection cause rustc's stack to overflow #121808
Labels
C-bug
Category: This is a bug.
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I was playing around with rust a bit and wanted to see what would happen
if I took a reference of a reference and so on. Out of curiosity I inserted
10000 '&' operators. The following code is the result of that.
I would have expected
rustc
to error out after a couple levels of references, after allthere is no reason to write the code above.
Instead
rustc
segfaulted due to a stack overflow. The same issue arises when using the nightly and beta versions.Meta
rustc --version --verbose
:rustc output
The text was updated successfully, but these errors were encountered: