arnholm / angelcad-samples

Sample scripts for the AngelCAD 3D solid modeler. Moved to https://gitlab.com/arnholm
MIT License
2 stars 0 forks source link

Segfault on syntax error #1

Closed tturpin closed 4 years ago

tturpin commented 4 years ago

Hi, I tried Angelcad, it looks interesting. However syntax error handling seems missing (could be helpful to learn the language):

To reproduce (on Ubuntu 18.04, installed with angelcad-1.3-02-ubuntu-18.04.3-lts.zip) :

arnholm commented 4 years ago

Hi and thanks for the report! If you remove line 12 in that file you must also remove the preceding comma, otherwise there is likely a null reference in the final array element. So did you get a segfault after removing the comma? I will check to see later if I can reproduce any segfault.

arnholm commented 4 years ago

Hi, I was able to reproduce this bug, thank you for reporting it! The bug is now fixed as shown https://github.com/arnholm/angelcad/commit/2555bab06900046c1d2517411e38971b64de1ba2

After the fix, instead if segfaulting, the following error is now issued asERR : (line 16, col 4) : polygon exception: NULL element detected in polygon points, index=4

The fix will be in the next release of AngelCAD.