public ArrayList<LocalVariable> temp_ref_vars = new ArrayList<LocalVariable> ();
public int next_temp_var_id;
public bool current_method_inner_error;
+ public bool current_method_return;
public Map<string,string> variable_name_map = new HashMap<string,string> (str_hash, str_equal);
public EmitContext (Symbol? symbol = null) {
set { emit_context.current_method_inner_error = value; }
}
+ public bool current_method_return {
+ get { return emit_context.current_method_return; }
+ set { emit_context.current_method_return = value; }
+ }
+
public int next_coroutine_state = 1;
int next_block_id = 0;
Map<Block,int> block_map = new HashMap<Block,int> ();
if (return_expression_symbol != null) {
return_expression_symbol.active = true;
}
+
+ // required for destructors
+ current_method_return = true;
}
public string get_symbol_lock_name (string symname) {
ccode.add_declaration ("GError *", new CCodeVariableDeclarator.zero ("_inner_error_", new CCodeConstant ("NULL")));
}
- // support return statements in destructors
- ccode.add_label ("_return");
+ if (current_method_return) {
+ // support return statements in destructors
+ ccode.add_label ("_return");
+ }
}
pop_context ();