[pypy-svn] r39836 - pypy/dist/pypy/objspace
pedronis at codespeak.net
pedronis at codespeak.net
Sat Mar 3 18:44:01 CET 2007
Author: pedronis
Date: Sat Mar 3 18:44:00 2007
New Revision: 39836
Modified:
pypy/dist/pypy/objspace/taint.py
Log:
one more step trying to make tain translatable
Modified: pypy/dist/pypy/objspace/taint.py
==============================================================================
--- pypy/dist/pypy/objspace/taint.py (original)
+++ pypy/dist/pypy/objspace/taint.py Sat Mar 3 18:44:00 2007
@@ -205,6 +205,27 @@
self.wrap(app_taint_look))
patch_space_in_place(self, 'taint', proxymaker)
+ # XXX may leak info, perfomance hit
+ from pypy.objspace.std.typeobject import W_TypeObject
+
+ def taint_lookup(w_obj, name):
+ if isinstance(w_obj, W_Tainted):
+ w_obj = w_obj.w_obj
+ w_type = self.type(w_obj)
+ assert isinstance(w_type, W_TypeObject)
+ return w_type.lookup(name)
+
+ def taint_lookup_in_type_where(w_obj, name):
+ if isinstance(w_obj, W_Tainted):
+ w_type = w_obj.w_obj
+ else:
+ w_type = w_obj
+ assert isinstance(w_type, W_TypeObject)
+ return w_type.lookup_where(name)
+
+ self.lookup = taint_lookup
+ self.lookup_in_type_where = taint_lookup_in_type_where
+
Space = TaintSpace
More information about the Pypy-commit
mailing list