1.1 --- a/micropython/trans.py Sun Aug 21 21:38:56 2011 +0200
1.2 +++ b/micropython/trans.py Sun Aug 21 23:59:52 2011 +0200
1.3 @@ -856,7 +856,9 @@
1.4 self.new_op(temp)
1.5 self.new_op(StoreCallable(source="source"))
1.6
1.7 - self.new_op(temp)
1.8 + # Prevent the above instruction from being modified.
1.9 +
1.10 + self.new_op(temp.copy())
1.11 #self.discard_temp(temp)
1.12 else:
1.13 self.new_op(LoadFunction(fn))
1.14 @@ -931,12 +933,7 @@
1.15 if not fn.is_lambda():
1.16 self.dispatch(compiler.ast.Name("None"))
1.17
1.18 - # NOTE: Cannot guarantee that all active instructions can be set.
1.19 - #self.set_target("result")
1.20 -
1.21 - self.new_op(Transfer(source="working", target="result"))
1.22 - self.new_op(Transfer(source="working_context", target="result_context"))
1.23 -
1.24 + self.set_target("result")
1.25 self.new_op(Return())
1.26
1.27 # Make sure that enough frame space is reserved from the start.
1.28 @@ -1301,6 +1298,7 @@
1.29 boolean status.
1.30 """
1.31
1.32 + false_block = self.get_block()
1.33 true_block = self.new_block()
1.34 end_block = self.new_block()
1.35
1.36 @@ -1311,7 +1309,7 @@
1.37 self.set_block(true_block)
1.38 self.new_op(LoadConst(self.importer.get_predefined_constant("True")))
1.39
1.40 - self.set_block(end_block)
1.41 + self.set_block(end_block, [false_block, true_block])
1.42
1.43 def _visitPrint(self, node, function_name):
1.44 self._startCallFunc()