[pypy-commit] pypy default: Complain if we see "lltype.free(x, track_allocation=False)". Should

arigo noreply at buildbot.pypy.org
Wed Dec 14 18:07:53 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r50509:b1a9e14a476c
Date: 2011-12-14 17:14 +0100
http://bitbucket.org/pypy/pypy/changeset/b1a9e14a476c/

Log:	Complain if we see "lltype.free(x, track_allocation=False)". Should
	be fixed.

diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -531,8 +531,11 @@
                                   op.result)
 
     def rewrite_op_free(self, op):
-        flags = op.args[1].value
-        assert flags['flavor'] == 'raw'
+        d = op.args[1].value.copy()
+        assert d['flavor'] == 'raw'
+        d.pop('flavor')
+        if d:
+            raise UnsupportedMallocFlags(d)
         ARRAY = op.args[0].concretetype.TO
         return self._do_builtin_call(op, 'raw_free', [op.args[0]],
                                      extra = (ARRAY,), extrakey = ARRAY)


More information about the pypy-commit mailing list