Inappropriate loops behaviour <for(), foreach(), break, continue>, segmentation fault while producing stacktrace
Openopened 4 years ago by belliash · 3 comments
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Your problem description
I have written another test - sudoku solver. It causes AerScript interpreter to fail. Sometimes it simply results in no solution, sometimes throws segmentation fault. When investigating issue, I realized this is connected with LOOP frames. After modifying code, to not declare variables repeatedly inside loops and removing OP_LOOP_START and OP_LOOP_START calls from PH7_CompileFor(), PH7_CompileBreak() and PH7_CompileContinue(), attached script has begun to work properly. Additionally, during investigation I have found another problem with for() loop statement:
Attached affected script.
709b5971c6fixes the segmentation fault problem. There is still a need to investigate and resolve problem of variables scopes.
Sudoku solver test added in