[pypy-commit] creflect default: fix asserts

arigo noreply at buildbot.pypy.org
Sat Dec 6 19:42:31 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r189:08d9551d66e1
Date: 2014-12-06 19:42 +0100
http://bitbucket.org/cffi/creflect/changeset/08d9551d66e1/

Log:	fix asserts

diff --git a/zeffir/builder.c b/zeffir/builder.c
--- a/zeffir/builder.c
+++ b/zeffir/builder.c
@@ -522,7 +522,6 @@
     if (interned_fields == NULL)
         return;
 
-    assert(ct->ct_fields == NULL);
     previous = &ct->ct_fields;
 
     for (i = 0; i < nfields; i++) {
diff --git a/zeffir/cdata.c b/zeffir/cdata.c
--- a/zeffir/cdata.c
+++ b/zeffir/cdata.c
@@ -781,6 +781,7 @@
         return 0;
     }
     if (ct->ct_flags & (CT_STRUCT|CT_UNION)) {
+        assert(ct->ct_size >= 0);
 
         if (CData_Check(init)) {
             if (((CDataObject *)init)->c_type == ct && ct->ct_size >= 0) {


More information about the pypy-commit mailing list