]> git.mxchange.org Git - simgear.git/commitdiff
Fix GC interaction. The "me" reference to a method call was being
authorandy <andy>
Tue, 23 Mar 2004 00:42:56 +0000 (00:42 +0000)
committerandy <andy>
Tue, 23 Mar 2004 00:42:56 +0000 (00:42 +0000)
popped off the stack in a situation where it could be garbage
collected.  I believe this is the source of the spurious "non-object
have no members" bug that has been reported.

simgear/nasal/code.c

index 3bd1e5ab65b24eb8271bf3b0dd6abb4fc0bb654b..02829f711bf889ee1d722bd8910565ecaf63f7c3 100644 (file)
@@ -454,6 +454,7 @@ static void run1(struct Context* ctx, struct Frame* f, naRef code)
         break;
     case OP_MCALL:
         c = POP(ctx); b = POP(ctx); a = POP(ctx); // a,b,c = obj, func, args
+        naVec_append(ctx->temps, a);
         setupFuncall(ctx, b, c);
         naHash_set(ctx->fStack[ctx->fTop-1].locals, ctx->meRef, a);
         break;