Example:
# strings mystrs = defarray("y$i") # yields only strange error message
strings mystrs = defarray("y$iy")
loop foreach i mystrs # i "needs" to match the input here to provoke it
print "$i"
endloop
This is about substitute_dollar_targ() in monte_carlo.c. Some of the relevant lines are surely the copies:
strcpy(q, p + targlen);
strcpy(p, ins);
strcpy(p + inslen, q);
I'm also noting the existing comment / += strlen(ins)? / (instead of s++), but I don't know if that would be or contribute to the solution.
This is now fixed in git, in the sense that given a "foreach" loop over an array of strings, we check the strings and flag an error if any of them contain "$ivar", where
ivaris the index variable. So, no crash but an error if this sort of recursion is detected.Am 05.09.2026 um 14:35 schrieb Allin Cottrell: