aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-11-21 13:53:08 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-11-21 13:53:08 -0500
commite80e8a80993734f22e9e9c1b8ba078b0b9b946c3 (patch)
treee9478d4436b275a7eeed841467a50b9054ab8340 /src/analyze.cpp
parent67d565136abd904b67792ae61f195a4054463b00 (diff)
downloadzig-e80e8a80993734f22e9e9c1b8ba078b0b9b946c3.tar.gz
zig-e80e8a80993734f22e9e9c1b8ba078b0b9b946c3.zip
IR: fix detection of invalid codegen
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index bbd9fd68a6..56fa6fae63 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -838,9 +838,9 @@ static IrInstruction *analyze_const_value(CodeGen *g, BlockContext *scope, AstNo
{
IrExecutable ir_executable = {0};
IrExecutable analyzed_executable = {0};
- IrInstruction *pass1 = ir_gen(g, node, scope, &ir_executable);
+ ir_gen(g, node, scope, &ir_executable);
- if (pass1->type_entry->id == TypeTableEntryIdInvalid)
+ if (ir_executable.invalid)
return g->invalid_instruction;
if (g->verbose) {
@@ -2552,8 +2552,8 @@ static void analyze_fn_body(CodeGen *g, FnTableEntry *fn_table_entry) {
buf_sprintf("byvalue types not yet supported on extern function return values"));
}
- IrInstruction *result = ir_gen_fn(g, fn_table_entry);
- if (result == g->invalid_instruction) {
+ ir_gen_fn(g, fn_table_entry);
+ if (fn_table_entry->ir_executable.invalid) {
fn_proto_node->data.fn_proto.skip = true;
fn_table_entry->anal_state = FnAnalStateSkipped;
return;