Author: Armin Rigo <[email protected]>
Branch: cffi-1.0
Changeset: r1814:fd28da258879
Date: 2015-04-25 11:38 +0200
http://bitbucket.org/cffi/cffi/changeset/fd28da258879/

Log:    fix: partially drop checking for internal consistency, which was
        bogus

diff --git a/_cffi1/realize_c_type.c b/_cffi1/realize_c_type.c
--- a/_cffi1/realize_c_type.c
+++ b/_cffi1/realize_c_type.c
@@ -448,8 +448,9 @@
                 PyTuple_SET_ITEM(enumerators, i, tmp);
 
                 gindex = search_in_globals(&builder->ctx, p, j);
+                assert(gindex >= 0);
                 g = &builder->ctx.globals[gindex];
-                assert(gindex >= 0 && g->type_op == op);
+                assert(g->type_op == _CFFI_OP(_CFFI_OP_ENUM, -1));
 
                 tmp = realize_global_int(g);
                 PyTuple_SET_ITEM(enumvalues, i, tmp);
diff --git a/_cffi1/recompiler.py b/_cffi1/recompiler.py
--- a/_cffi1/recompiler.py
+++ b/_cffi1/recompiler.py
@@ -619,7 +619,7 @@
 
     def _enum_ctx(self, tp, cname):
         type_index = self._typesdict[tp]
-        type_op = '_CFFI_OP(_CFFI_OP_ENUM, %d)' % type_index
+        type_op = '_CFFI_OP(_CFFI_OP_ENUM, -1)'
         for enumerator in tp.enumerators:
             self._lsts["global"].append(
                 '  { "%s", _cffi_const_%s, %s },' % (enumerator, enumerator,
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to