1
0
forked from Mirror/wren

Don't confuse the GC if a collection occurs after a compile error.

This commit is contained in:
Bob Nystrom
2015-04-03 23:12:14 -07:00
parent 82ce1d8be9
commit bb3de9eeba

View File

@ -1297,6 +1297,8 @@ static ObjFn* endCompiler(Compiler* compiler,
// anyway. // anyway.
if (compiler->parser->hasError) if (compiler->parser->hasError)
{ {
wrenSetCompiler(compiler->parser->vm, compiler->parent);
// Free the code since it won't be used. // Free the code since it won't be used.
freeCompiler(compiler); freeCompiler(compiler);
return NULL; return NULL;