help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] JIT crashes due non-executable memory


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] JIT crashes due non-executable memory
Date: Sun, 2 Jun 2013 18:46:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Jun 02, 2013 at 06:13:28PM +0200, Holger Hans Peter Freyther wrote:

> I am trying to figure out where the -1 is coming from and when
> the context is changed but searching for sp and and -1 is not
> really helping. :) 

The BlockClosure>>#asContext: was changed in 2007 in git revision
51f4dffef9df9095e59801df57741bd1a9458fd3. 


diff --git a/kernel/BlkClosure.st b/kernel/BlkClosure.st
index ec17d2b..cd07652 100644
--- a/kernel/BlkClosure.st
+++ b/kernel/BlkClosure.st
@@ -167,13 +167,15 @@ creation of Processes from blocks.'>
         Note that the block has no home, so it cannot contain returns."
 
        <category: 'private'>
+       "parent ifNotNil: [parent inspect. parent method inspect]."
+
        ^BlockContext
            fromClosure: [
                | top |
                top := parent isNil
                    ifTrue: [nil]
                    ifFalse: [
-                       parent sp == 0 
+                       parent sp <= 0 
                            ifTrue: [parent receiver]
                            ifFalse: [parent at: parent sp]].
                self value. top]



this works around the problem but I don't understand enough of it.
When will the sp != 0 for the Interpreter? Where does the assumption
if parent sp != 0 => parent is at this position. Or why shouldn't
this code be inside the context class? if the receiver is burried in
the stack.. then the class should be able to find it self?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]