Author: Armin Rigo <[email protected]>
Branch:
Changeset: r75107:8e44078cb486
Date: 2014-12-24 20:36 +0100
http://bitbucket.org/pypy/pypy/changeset/8e44078cb486/
Log: Clarify the assertion error.
diff --git a/rpython/jit/metainterp/virtualizable.py
b/rpython/jit/metainterp/virtualizable.py
--- a/rpython/jit/metainterp/virtualizable.py
+++ b/rpython/jit/metainterp/virtualizable.py
@@ -49,7 +49,13 @@
ARRAYPTR = fieldType(VTYPE, name)
ARRAY = deref(ARRAYPTR)
assert isinstance(ARRAYPTR, lltype.Ptr)
- assert isinstance(ARRAY, lltype.GcArray)
+ if not isinstance(ARRAY, lltype.GcArray):
+ raise Exception(
+ "The virtualizable field '%s' is not an array (found %r)."
+ " It usually means that you must try harder to ensure that"
+ " the list is not resized at run-time. You can do that by"
+ " using rpython.rlib.debug.make_sure_not_resized()." %
+ (name, ARRAY))
ARRAYITEMTYPES.append(arrayItem(ARRAY))
self.array_descrs = [cpu.arraydescrof(deref(fieldType(VTYPE, name)))
for name in array_fields]
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit