Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r74485:5304fa92e01f
Date: 2014-11-12 18:02 +0100
http://bitbucket.org/pypy/pypy/changeset/5304fa92e01f/
Log: Test and fix
diff --git a/rpython/rlib/rstm.py b/rpython/rlib/rstm.py
--- a/rpython/rlib/rstm.py
+++ b/rpython/rlib/rstm.py
@@ -200,6 +200,8 @@
llop.stm_hashtable_tracefn(lltype.Void, addr.address[0], visit_fn)
lambda_hashtable_trace = lambda: ll_hashtable_trace
+_false = CDefinedIntSymbolic('0', default=0) # remains in the C code
+
def create_hashtable():
if not we_are_translated():
return HashtableForTest() # for tests
@@ -207,7 +209,7 @@
# Make sure we see a malloc() of it, so that its typeid is correctly
# initialized. It can be done in a NonConstant(False) path so that
# the C compiler will actually drop it.
- if NonConstant(False):
+ if _false:
p = lltype.malloc(_STM_HASHTABLE_ENTRY)
else:
p = lltype.nullptr(_STM_HASHTABLE_ENTRY)
diff --git a/rpython/translator/stm/test/test_ztranslated.py
b/rpython/translator/stm/test/test_ztranslated.py
--- a/rpython/translator/stm/test/test_ztranslated.py
+++ b/rpython/translator/stm/test/test_ztranslated.py
@@ -584,3 +584,7 @@
t, cbuilder = self.compile(main)
data = cbuilder.cmdexec('')
assert 'ok!\n' in data
+
+ t, cbuilder = self.compile(main, backendopt=True)
+ data = cbuilder.cmdexec('')
+ assert 'ok!\n' in data
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit