Running out of RAM during compilation #62637
Labels
C-bug
Category: This is a bug.
I-compilemem
Issue: Problems and improvements with respect to memory usage during compilation.
P-medium
Medium priority
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hi
Incorrectly closing the parentheses around an if expression causes the compiler to be stuck in endless recursion (probably), causing the computer to run out of memory.
I encountered this bug while trying to return
Some(if cond { ... } else { ... })
from a function by accidentally placing the left parenthesis right after the if condition:Some(if ...) { } else { }
.The code below is the minimal example I came up with that reproduces the bug. Please run it carefully since it rapidly consumes RAM (2 GB/s on my machine).
Compiler output:
Meta
The bug is present in both available for me compilers:
and
My OS is Arch Linux
5.1.11-arch1-1-ARCH
.The text was updated successfully, but these errors were encountered: