Showing the changes to src/core/chuck_emit.cpp (1 of 2 files). Show all
Unified · Split
| @@ -1331,7 +1331,7 @@ t_CKBOOL emit_engine_emit_return( Chuck_Emitter * emit, a_Stmt_Return stmt ) · 1330 unmodified lines | |||
| 1331 | return FALSE; | 1331 | return FALSE; |
| 1332 | 1332 | ||
| 1333 | // if return is an object type | 1333 | // if return is an object type |
| 1334 | if( isobj( emit->env, stmt->val->type ) ) | 1334 | if( stmt->val && isobj( emit->env, stmt->val->type ) ) |
| 1335 | { | 1335 | { |
| 1336 | // add reference (to be released by the function caller) | 1336 | // add reference (to be released by the function caller) |
| 1337 | emit->append( new Chuck_Instr_Reg_AddRef_Object3 ); | 1337 | emit->append( new Chuck_Instr_Reg_AddRef_Object3 ); |