aardappel / lobster

The Lobster Programming Language

Home Page:http://strlen.com/lobster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on compile error when Compile max_errors > 1

MortimerSnerd opened this issue · comments

Only happens if you pass --errors to the command line, or you're calling Compile() directly and pass a max_errors > 1.

Example program:

def do_something(v): 
   // . instead of comma after second float3 parameter
   gl_translate(float3{v.x, v.y. v.z})

The crash is because line 106 in ParseStatements() calls children.back() right after error recovery, but it is empty.

Not a high priority, I just changed my call to do max_errors of 1 - I can't recall if I've seen more than one error in any case, so I had passed in 10 on a lark, not because it was necessary.

Interesting, yeah that code has not been tested much, I'll have a look :)