Author: Lars Wassermann <[email protected]>
Branch:
Changeset: r425:2126b202547a
Date: 2013-05-30 15:34 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/2126b202547a/
Log: added size-check for varsized object creation
diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -457,7 +457,10 @@
s_class = w_cls.as_class_get_shadow(interp.space)
if not s_class.isvariable():
raise PrimitiveFailedError()
- return s_class.new(size)
+ try:
+ return s_class.new(size)
+ except MemoryError:
+ raise PrimitiveFailedError
@expose_primitive(ARRAY_BECOME_ONE_WAY, unwrap_spec=[object, object])
def func(interp, s_frame, w_obj1, w_obj2):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit