Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r76023:1dba5a90fd28
Date: 2015-02-20 21:36 +0100
http://bitbucket.org/pypy/pypy/changeset/1dba5a90fd28/
Log: really fix it
diff --git a/rpython/translator/c/funcgen.py b/rpython/translator/c/funcgen.py
--- a/rpython/translator/c/funcgen.py
+++ b/rpython/translator/c/funcgen.py
@@ -678,13 +678,15 @@
OP_CAST_PTR_TO_ADR = OP_CAST_POINTER
def OP_LENGTH_OF_SIMPLE_GCARRAY_FROM_OPAQUE(self, op):
- header0 = 'struct pypy_header0'
- if hasattr(self.db.gcpolicy, 'headertype'):
- header0 = self.db.gcpolicy.headertype('')
- return ('%s = *(long *)(((char *)%s) + sizeof(%s));'
+ if self.db.with_stm:
+ header0 = 'rpyobj_t'
+ long0 = 'TLPREFIX long'
+ else:
+ header0 = 'struct pypy_header0'
+ long0 = 'long'
+ return ('%s = *(%s *)(((%s *)%s) + 1);'
' /* length_of_simple_gcarray_from_opaque */'
- % (self.expr(op.result), self.expr(op.args[0]),
- header0))
+ % (self.expr(op.result), long0, header0, self.expr(op.args[0])))
def OP_CAST_INT_TO_PTR(self, op):
TYPE = self.lltypemap(op.result)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit