Author: Stephan <[email protected]>
Branch: 
Changeset: r48:ad0c3ac94676
Date: 2011-05-12 17:34 +0200
http://bitbucket.org/pypy/lang-js/changeset/ad0c3ac94676/

Log:    make sure JsFunction.opcodes are not resized

diff --git a/js/jscode.py b/js/jscode.py
--- a/js/jscode.py
+++ b/js/jscode.py
@@ -107,7 +107,7 @@
         if self.has_labels:
             self.remove_labels()
 
-        return JsFunction(name, params, self.opcodes)
+        return JsFunction(name, params, self.opcodes[:])
 
     def remove_labels(self):
         """ Basic optimization to remove all labels and change
@@ -134,9 +134,10 @@
 
 class JsFunction(object):
     def __init__(self, name, params, code):
+        from pypy.rlib.debug import make_sure_not_resized
         self.name = name
         self.params = params
-        self.opcodes = code
+        self.opcodes = make_sure_not_resized(code)
 
     def run(self, ctx, check_stack=True):
         if we_are_translated():
diff --git a/js/operations.py b/js/operations.py
--- a/js/operations.py
+++ b/js/operations.py
@@ -10,7 +10,7 @@
      w_Null, W_BaseNumber, isnull_or_undefined
 from pypy.rlib.parsing.ebnfparse import Symbol, Nonterminal
 from js.execution import JsTypeError, ThrowException
-from js.jscode import JsCode, JsFunction
+from js.jscode import JsCode
 from constants import unescapedict
 from pypy.rlib.unroll import unrolling_iterable
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to