fix check-statement-is-void. add tests

see #291
This commit is contained in:
Josh Wolfe
2017-04-23 21:49:42 -07:00
parent c6605cba83
commit ac7971122d
3 changed files with 33 additions and 2 deletions

View File

@@ -12666,7 +12666,7 @@ static TypeTableEntry *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira
static TypeTableEntry *ir_analyze_instruction_check_statement_is_void(IrAnalyze *ira,
IrInstructionCheckStatementIsVoid *instruction)
{
IrInstruction *statement_value = instruction->statement_value;
IrInstruction *statement_value = instruction->statement_value->other;
TypeTableEntry *statement_type = statement_value->value.type;
if (type_is_invalid(statement_type))
return ira->codegen->builtin_types.entry_invalid;