[pypy-commit] pypy more-rposix: Better placement for sandbox properties

amauryfa noreply at buildbot.pypy.org
Sat Dec 6 11:41:59 CET 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: more-rposix
Changeset: r74850:3b5d1aeee6d5
Date: 2014-12-06 11:37 +0100
http://bitbucket.org/pypy/pypy/changeset/3b5d1aeee6d5/

Log:	Better placement for sandbox properties

diff --git a/rpython/rlib/objectmodel.py b/rpython/rlib/objectmodel.py
--- a/rpython/rlib/objectmodel.py
+++ b/rpython/rlib/objectmodel.py
@@ -296,12 +296,12 @@
         class ExtRegistry(ExtRegistryEntry):
             _about_ = replaced_function
             def compute_annotation(self):
+                if sandboxed_name:
+                    config = self.bookkeeper.annotator.translator.config
+                    if config.translation.sandbox:
+                        func._sandbox_external_name = sandboxed_name
+                        func._dont_inline_ = True
                 return self.bookkeeper.immutablevalue(func)
-
-        if sandboxed_name:
-            func._sandbox_external_name = sandboxed_name
-            # XXX THIS IS NOT CORRECT. Only do this when config.sandbox.
-            func._dont_inline_ = True
         return func
     return wrap
 


More information about the pypy-commit mailing list