[pypy-svn] r35387 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Wed Dec 6 13:36:58 CET 2006


Author: arigo
Date: Wed Dec  6 13:36:57 2006
New Revision: 35387

Modified:
   pypy/dist/pypy/rpython/rtyper.py
Log:
A more detailed sanity-checking logic.  Avoids crashes in the jit, too.


Modified: pypy/dist/pypy/rpython/rtyper.py
==============================================================================
--- pypy/dist/pypy/rpython/rtyper.py	(original)
+++ pypy/dist/pypy/rpython/rtyper.py	Wed Dec  6 13:36:57 2006
@@ -712,8 +712,6 @@
         return vars
 
     def genop(self, opname, args_v, resulttype=None):
-        assert args_v is not self.args_v, ("Wrong level! "
-            "You need to pass the result of hop.inputargs() to genop().")
         return self.llops.genop(opname, args_v, resulttype)
 
     def gendirectcall(self, ll_function, *args_v):
@@ -824,6 +822,13 @@
         return v
 
     def genop(self, opname, args_v, resulttype=None):
+        try:
+            for v in args_v:
+                v.concretetype
+        except AttributeError:
+            raise AssertionError("wrong level!  you must call hop.inputargs()"
+                                 " and pass its result to genop(),"
+                                 " never hop.args_v directly.")
         vresult = Variable()
         self.append(SpaceOperation(opname, args_v, vresult))
         if resulttype is None:



More information about the Pypy-commit mailing list