vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.14k stars 136 forks source link

Segfault for local expression defined in terms of itself #164

Open jodavies opened 7 years ago

jodavies commented 7 years ago

The following program produces a segfault:

Local test = test + 1;
.end

Of course it is a bad program, but it would be helpful to catch the error gracefully and print an error message. Tested with the latest commit, fa1c759.

Thanks, Josh.

tueda commented 7 years ago

The segfault is due to (intentional) stack overflow at runtime. Please see #57. Related tricky cases are

L F = 1;
.sort
L F = F + 1;  * (= 2)
P;
.end
L F = 1;
L G = F + 1;  * (= 2)
P;
.end

They have to be valid as used in many programs.