1.1 --- a/rsvp.py Sun Apr 05 03:05:59 2009 +0200
1.2 +++ b/rsvp.py Sun Apr 05 03:41:21 2009 +0200
1.3 @@ -325,7 +325,7 @@
1.4 # Instructions.
1.5
1.6 def LoadConst(self):
1.7 - self.value = None, self.operand
1.8 + self.value = self.operand, self.operand
1.9
1.10 def LoadName(self):
1.11 frame = self.local_sp_stack[-1]
1.12 @@ -478,7 +478,7 @@
1.13
1.14 def LoadContext(self):
1.15 context, ref = self.value
1.16 - self.value = None, context
1.17 + self.value = context, context
1.18
1.19 def CheckFrame(self):
1.20 operand = self.operand
1.21 @@ -561,7 +561,7 @@
1.22 return self.operand
1.23
1.24 def LoadException(self):
1.25 - self.value = None, self.exception
1.26 + self.value = self.exception, self.exception
1.27
1.28 def StoreException(self):
1.29 self.exception = self.value[1]
1.30 @@ -696,11 +696,20 @@
1.31 else:
1.32 self.result = self.false_constant, self.false_constant
1.33
1.34 + def builtins_bool_bool(self):
1.35 + frame = self.local_sp_stack[-1]
1.36 +
1.37 + # Get operands addresses.
1.38 +
1.39 + left_context, left = self.frame_stack[frame]
1.40 + self.result = left, left
1.41 +
1.42 native_functions = {
1.43 "__builtins__.object.__init__" : builtins_object_init,
1.44 "__builtins__.int.__init__" : builtins_int_init,
1.45 "__builtins__.int.__add__" : builtins_int_add,
1.46 "__builtins__.int.__bool__" : builtins_int_bool,
1.47 + "__builtins__.bool.__bool__" : builtins_bool_bool,
1.48 }
1.49
1.50 # vim: tabstop=4 expandtab shiftwidth=4