append_local_free (current_symbol, free_frag, false);
cerror_block.add_statement (free_frag);
- if (current_return_type is VoidType) {
+ if (current_method is CreationMethod) {
+ cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+ } else if (current_method != null && current_method.coroutine) {
+ cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("FALSE")));
+ } else if (current_return_type is VoidType) {
cerror_block.add_statement (new CCodeReturnStatement ());
} else {
cerror_block.add_statement (new CCodeReturnStatement (default_value_for_type (current_return_type, false)));