aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-22 10:46:22 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-22 10:46:22 -0400
commitc84548e71d4990352c202da92d47f1398385411f (patch)
treea4c4ee25ba2708c1c3ffb92a9942cff58bfa1677 /src
parent3c1f9baff10be20910fc6e168c293759d9b8537e (diff)
downloadzig-c84548e71d4990352c202da92d47f1398385411f.tar.gz
zig-c84548e71d4990352c202da92d47f1398385411f.zip
fix @compileLog having unintended side effects
closes #1459
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 7e98e99af1..95172e2b59 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -9874,6 +9874,7 @@ static ZigType *ir_resolve_type(IrAnalyze *ira, IrInstruction *type_value) {
if (!const_val)
return ira->codegen->builtin_types.entry_invalid;
+ assert(const_val->data.x_type != nullptr);
return const_val->data.x_type;
}
@@ -16880,7 +16881,9 @@ static ZigType *ir_analyze_instruction_compile_log(IrAnalyze *ira, IrInstruction
}
fprintf(stderr, "\n");
- ir_add_error(ira, &instruction->base, buf_sprintf("found compile log statement"));
+ // Here we bypass higher level functions such as ir_add_error because we do not want
+ // invalidate_exec to be called.
+ add_node_error(ira->codegen, instruction->base.source_node, buf_sprintf("found compile log statement"));
ir_build_const_from(ira, &instruction->base);
return ira->codegen->builtin_types.entry_void;