Author: Lars Wassermann <[email protected]>
Branch: 
Changeset: r238:c79d9f581fe7
Date: 2013-03-26 11:26 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/c79d9f581fe7/

Log:    fixed a bug in perform_with_args and added some comments

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -1100,13 +1100,16 @@
 def func(interp, s_frame, w_rcvr, w_selector, args_w):
     stackvalues = s_frame.pop_and_return_n(3)
     argcount = len(args_w)
+    # pushing the receiver and args to be popped by _sendSelector
     s_frame.push(w_rcvr)
     s_frame.push_all(args_w)
-    try:
-        s_frame._sendSelector(w_selector, argcount, interp,
+    s_frame._sendSelector(w_selector, argcount, interp,
                       w_rcvr, w_rcvr.shadow_of_my_class(interp.space))
-    finally:
-        s_frame.push_all(stackvalues)
+    # If we return in a regular way, we need to rebuild the former
+    # stack-contents to be collected by the primitive wrapper, i.a. if
+    # w_selector points to a primitive method. But if we have an exception, the
+    # wrapper will not clean. Therefore we should not put this into a finally.
+    s_frame.push_all(stackvalues)
 
 
 @expose_primitive(SIGNAL, unwrap_spec=[object])
diff --git a/spyvm/test/test_bootstrappedimage.py 
b/spyvm/test/test_bootstrappedimage.py
--- a/spyvm/test/test_bootstrappedimage.py
+++ b/spyvm/test/test_bootstrappedimage.py
@@ -52,6 +52,7 @@
     tools.test_lookup_abs_in_integer()
 
 def test_tinyBenchmarks():
+    py.test.skip("Waste of time, because it doesn't assert anything.")
     # we can't find PCSystem, because Smalltalkdict is nil...
     import time
     t0 = time.time()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to