Get rid of totally broken WREN_PIN. Fix #128.
This commit is contained in:
+4
-4
@@ -1258,7 +1258,7 @@ static ObjFn* endCompiler(Compiler* compiler,
|
||||
compiler->parser->sourcePath,
|
||||
debugName, debugNameLength,
|
||||
compiler->debugSourceLines.data);
|
||||
WREN_PIN(compiler->parser->vm, fn);
|
||||
wrenPushRoot(compiler->parser->vm, (Obj*)fn);
|
||||
|
||||
// In the function that contains this one, load the resulting function object.
|
||||
if (compiler->parent != NULL)
|
||||
@@ -1290,7 +1290,7 @@ static ObjFn* endCompiler(Compiler* compiler,
|
||||
// Pop this compiler off the stack.
|
||||
wrenSetCompiler(compiler->parser->vm, compiler->parent);
|
||||
|
||||
WREN_UNPIN(compiler->parser->vm);
|
||||
wrenPopRoot(compiler->parser->vm);
|
||||
|
||||
#if WREN_DEBUG_DUMP_COMPILED_CODE
|
||||
wrenDebugPrintCode(compiler->parser->vm, fn);
|
||||
@@ -2810,7 +2810,7 @@ ObjFn* wrenCompile(WrenVM* vm, const char* sourcePath, const char* source)
|
||||
{
|
||||
ObjString* sourcePathObj = AS_STRING(wrenNewString(vm, sourcePath,
|
||||
strlen(sourcePath)));
|
||||
WREN_PIN(vm, sourcePathObj);
|
||||
wrenPushRoot(vm, (Obj*)sourcePathObj);
|
||||
|
||||
Parser parser;
|
||||
parser.vm = vm;
|
||||
@@ -2841,7 +2841,7 @@ ObjFn* wrenCompile(WrenVM* vm, const char* sourcePath, const char* source)
|
||||
initCompiler(&compiler, &parser, NULL, true);
|
||||
ignoreNewlines(&compiler);
|
||||
|
||||
WREN_UNPIN(vm);
|
||||
wrenPopRoot(vm);
|
||||
|
||||
while (!match(&compiler, TOKEN_EOF))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user