}
self->expression.outr = (ir_value*)1;
- cgen = self->operand->expression.codegen;
- /* lvalue! */
- if (!(*cgen)((ast_expression*)(self->operand), func, false, &operand))
- return false;
+ if (self->operand) {
+ cgen = self->operand->expression.codegen;
+ /* lvalue! */
+ if (!(*cgen)((ast_expression*)(self->operand), func, false, &operand))
+ return false;
- if (!ir_block_create_return(func->curblock, operand))
- return false;
+ if (!ir_block_create_return(func->curblock, operand))
+ return false;
+ } else {
+ if (!ir_block_create_return(func->curblock, NULL))
+ return false;
+ }
return true;
}
if (!in)
return false;
- if (!ir_instr_op(in, 0, v, false) ||
- !ir_block_instr_add(self, in) )
- {
+ if (v && !ir_instr_op(in, 0, v, false))
+ return false;
+
+ if (!ir_block_instr_add(self, in))
return false;
- }
return true;
}