[pypy-commit] lang-smalltalk default: (lwassermann, timfel) fix nlr when underflowing python c stack

timfel noreply at buildbot.pypy.org
Tue Apr 23 18:14:16 CEST 2013


Author: Tim Felgentreff <timfelgentreff at gmail.com>
Branch: 
Changeset: r319:17a80c53451f
Date: 2013-04-23 16:12 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/17a80c53451f/

Log:	(lwassermann, timfel) fix nlr when underflowing python c stack

diff --git a/spyvm/interpreter.py b/spyvm/interpreter.py
--- a/spyvm/interpreter.py
+++ b/spyvm/interpreter.py
@@ -65,13 +65,16 @@
         s_new_context = w_active_context.as_context_get_shadow(self.space)
         while True:
             assert self.remaining_stack_depth == self.max_stack_depth
+            # Need to save s_sender, c_loop will nil this on return
             s_sender = s_new_context.s_sender()
             try:
                 s_new_context = self.c_loop(s_new_context)
             except StackOverflow, e:
                 s_new_context = e.s_context
             except Return, nlr:
+                s_new_context = s_sender
                 while s_new_context is not nlr.s_target_context:
+                    s_sender = s_new_context.s_sender()
                     s_new_context.mark_returned()
                     s_new_context = s_sender
                 s_new_context.push(nlr.value)


More information about the pypy-commit mailing list