BlockContext.st
changeset 15267 47d41a3d1cbf
parent 15220 62c90d2c1698
child 15382 5a8665b2765a
child 18062 014678b4657a
--- a/BlockContext.st	Fri May 24 19:09:05 2013 +0200
+++ b/BlockContext.st	Fri May 24 19:11:15 2013 +0200
@@ -127,13 +127,15 @@
 
     |con h|
 
+    home isNil ifTrue:[^ nil].
     home isContext ifFalse:[^ nil]. "copying blocks have no method home"
 
+    con := self.
     h := home.
-    [
+    [h notNil] whileTrue:[
         con := h.
         h := con home
-    ] doWhile:[h notNil].
+    ].
     ^ con
 !
 
@@ -167,7 +169,7 @@
 
     |cls who mHome m className sel homeSel|
 
-    home isContext ifFalse:[
+    (home isNil or:[home isContext not]) ifTrue:[
         "
          mhmh - an optimized blocks context
          should get the block here, and get the method from
@@ -252,10 +254,10 @@
 !BlockContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/BlockContext.st,v 1.36 2013-05-07 13:23:42 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/BlockContext.st,v 1.37 2013-05-24 17:11:15 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/BlockContext.st,v 1.36 2013-05-07 13:23:42 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/BlockContext.st,v 1.37 2013-05-24 17:11:15 cg Exp $'
 ! !