env.use_utility_code(generator_utility_code)
def generate_evaluation_code(self, code):
- saved = []
- self.temp_allocator.reset()
- code.putln('/* Save temporary variables */')
- for cname, type, manage_ref in code.funcstate.temps_in_use():
- save_cname = self.temp_allocator.allocate_temp(type)
- saved.append((cname, save_cname, type))
- code.putln('%s->%s = %s;' % (Naming.cur_scope_cname, save_cname, cname))
self.label_name = code.new_label('resume_from_yield')
code.use_label(self.label_name)
self.allocate_temp_result(code)
self.arg.free_temps(code)
else:
code.put_init_to_py_none(Naming.retval_cname, py_object_type)
+ saved = []
+ self.temp_allocator.reset()
+ code.putln('/* Save temporary variables */')
+ for cname, type, manage_ref in code.funcstate.temps_in_use():
+ save_cname = self.temp_allocator.allocate_temp(type)
+ saved.append((cname, save_cname, type))
+ code.putln('%s->%s = %s;' % (Naming.cur_scope_cname, save_cname, cname))
# XXX: safe here as all used temps are handled but not clean
self.temp_allocator.put_giveref(code)