Closed initbar closed 8 years ago
Thanks for finding this!
The interpreter tries to interpolate string lazily, so after the line VAR R ":{VAR}"
is executed, the value of VAR
is ":{VAR}"
. When VAR
is eventually interpolated in VISIBLE VAR
, the interpreter tries to expand it to ":{:{
...:{VAR}
...}}"
and runs out of memory.
To solve this problem, I will patch the interpreter to interpolate assigned strings.
Commit d42043c fixes this issue. I also patched the future
branch. Thanks again, @initbar!
While playing with lolcode, I've isolated the segfaulting code:
In here, the segfault happens only when
VISIBLE VAR
is called. I think the problem is with this line:after string interpolation of
VAR
and overwriting self.