if entry.is_cglobal:
code.put_giveref(rhs.py_result())
code.putln('%s = %s;' % (self.result(), rhs.result_as(self.ctype())))
+ if self.type.is_pyobject and self.entry.in_closure:
+ code.put_giveref(self.result())
if debug_disposal_code:
print("NameNode.generate_assignment_code:")
print("...generating post-assignment code for %s" % rhs)
def reassign(x):
def f(a):
return a+x
- x = 1 # currently lacks a GIVEREF()
+ x = 1
return f
def reassign_int(x):
def f(int a):
return a+x
- x = 1 # currently lacks a GIVEREF()
+ x = 1
return f
def reassign_int_int(int x):
def more_inner_funcs(x):
# pretty ugly segfault
- def f(a): # this lacks a GIVEREF()
+ def f(a):
def g(b):
return a+b+x
return g
- def g(b): # this lacks a GIVEREF()
+ def g(b):
def f(a):
return a+b+x
return f
- def h(b): # this lacks a GIVEREF()
+ def h(b):
def f(a):
return a+b+x
return f