From 476906d07265b355df55c111dd1fde36d10f813a Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Fri, 23 Dec 2011 13:21:53 +0100 Subject: [PATCH] sclang: fix returnFromMethod and returnFromBlock we should set the caller to integer 0 to ensure that the full slot is cleared. this has to be done to ensure that the pointer part of the slot gets cleared correctly. Signed-off-by: Tim Blechmann --- lang/LangSource/PyrMessage.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lang/LangSource/PyrMessage.cpp b/lang/LangSource/PyrMessage.cpp index 58f3c0d93..f259c182d 100644 --- a/lang/LangSource/PyrMessage.cpp +++ b/lang/LangSource/PyrMessage.cpp @@ -1164,7 +1164,7 @@ void returnFromBlock(VMGlobals *g) if (!methraw->needsHeapContext) { g->gc->Free(curframe); } else { - SetNil(&curframe->caller); + SetInt(&curframe->caller, 0); } } else { @@ -1277,9 +1277,10 @@ void returnFromMethod(VMGlobals *g) methraw = METHRAW(meth); PyrFrame *nextFrame = slotRawFrame(&tempFrame->caller); if (!methraw->needsHeapContext) { - g->gc->Free(tempFrame); + SetInt(&tempFrame->caller, 0); } else { - if (tempFrame != homeContext) SetNil(&tempFrame->caller); + if (tempFrame != homeContext) + SetInt(&tempFrame->caller, 0); } tempFrame = nextFrame; } -- 2.11.4.GIT