Commits

Armin Rigo committed 4959e3d

Fix various tests crashing because of my recent changes at rlib.rstack.

Comments (0)

Files changed (3)

pypy/rlib/rstack.py

 
 compilation_info = ExternalCompilationInfo(includes=['src/stack.h'])
 
-def llexternal(name, args, res):
+def llexternal(name, args, res, _callable=None):
     return rffi.llexternal(name, args, res, compilation_info=compilation_info,
-                           sandboxsafe=True, _nowrapper=True)
+                           sandboxsafe=True, _nowrapper=True,
+                           _callable=_callable)
 
-_stack_get_start = llexternal('LL_stack_get_start', [], lltype.Signed)
-_stack_get_length = llexternal('LL_stack_get_length', [], lltype.Signed)
+_stack_get_start = llexternal('LL_stack_get_start', [], lltype.Signed,
+                              lambda: 0)
+_stack_get_length = llexternal('LL_stack_get_length', [], lltype.Signed,
+                               lambda: 1)
 _stack_too_big_slowpath = llexternal('LL_stack_too_big_slowpath',
-                                     [lltype.Signed], lltype.Char)
+                                     [lltype.Signed], lltype.Char,
+                                     lambda cur: '\x00')
 # the following is used by the JIT
 _stack_get_start_adr = llexternal('LL_stack_get_start_adr', [], lltype.Signed)
 

pypy/rpython/llinterp.py

     def op_set_stack_depth_limit(self):
         raise NotImplementedError("set_stack_depth_limit")
 
+    def op_stack_current(self):
+        return 0
+
     # operations on pyobjects!
     for opname in lloperation.opimpls.keys():
         exec py.code.Source("""

pypy/translator/c/test/test_stackless.py

 from pypy.translator.c.genc import CStandaloneBuilder
 from pypy.translator.c import gc
 from pypy.annotation.listdef import s_list_of_strings
-from pypy.rlib.rstack import stack_unwind, stack_frames_depth, stack_too_big
+from pypy.rlib.rstack import stack_unwind, stack_frames_depth
 from pypy.rlib.rstack import yield_current_frame_to_caller, set_stack_depth_limit
 from pypy.config.config import Config
 import os