[pypy-svn] r13626 - pypy/dist/pypy/translator/c

ac at codespeak.net ac at codespeak.net
Mon Jun 20 16:44:53 CEST 2005


Author: ac
Date: Mon Jun 20 16:44:53 2005
New Revision: 13626

Modified:
   pypy/dist/pypy/translator/c/node.py
Log:
skip void fields in debuf offset table

Modified: pypy/dist/pypy/translator/c/node.py
==============================================================================
--- pypy/dist/pypy/translator/c/node.py	(original)
+++ pypy/dist/pypy/translator/c/node.py	Mon Jun 20 16:44:53 2005
@@ -151,8 +151,14 @@
 
     def debug_offsets(self):
         # generate number exprs giving the offset of the elements in the struct
-        for name, typename in self.fields:
-            yield 'offsetof(struct %s, %s)' % (self.name, name)
+        STRUCT = self.STRUCT
+        for name in STRUCT._names:
+            FIELD_T = self.c_struct_field_type(name)
+            if FIELD_T == Void:
+                yield '-1'
+            else:
+                cname = self.c_struct_field_name(name)
+                yield 'offsetof(struct %s, %s)' % (self.name, cname)
 
 
 class ArrayDefNode:



More information about the Pypy-commit mailing list