[pypy-svn] r30845 - pypy/dist/pypy/translator/cli

antocuni at codespeak.net antocuni at codespeak.net
Tue Aug 1 15:15:44 CEST 2006


Author: antocuni
Date: Tue Aug  1 15:15:43 2006
New Revision: 30845

Modified:
   pypy/dist/pypy/translator/cli/function.py
Log:
store last_exception only if it is a Variable.



Modified: pypy/dist/pypy/translator/cli/function.py
==============================================================================
--- pypy/dist/pypy/translator/cli/function.py	(original)
+++ pypy/dist/pypy/translator/cli/function.py	Tue Aug  1 15:15:43 2006
@@ -125,10 +125,13 @@
                         self.store(link.target.inputargs[1])
                     else:
                         # the exception value is on the stack, store it in the proper place
-                        self.ilasm.opcode('dup')
-                        self.store(link.last_exc_value)
-                        self.ilasm.get_field(('Object_meta', 'Object', 'meta'))
-                        self.store(link.last_exception)
+                        if isinstance(link.last_exception, flowmodel.Variable):
+                            self.ilasm.opcode('dup')
+                            self.store(link.last_exc_value)                            
+                            self.ilasm.get_field(('Object_meta', 'Object', 'meta'))
+                            self.store(link.last_exception)
+                        else:
+                            self.store(link.last_exc_value)
                         self._setup_link(link)
                     
                     target_label = self._get_block_name(target)



More information about the Pypy-commit mailing list