Get rid of totally broken WREN_PIN. Fix #128.

This commit is contained in:
Bob Nystrom
2015-01-21 07:56:06 -08:00
parent 9453acf1e6
commit 1d0f6a5033
5 changed files with 62 additions and 90 deletions
+4 -4
View File
@@ -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))
{