From c84548e71d4990352c202da92d47f1398385411f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 22 Sep 2018 10:46:22 -0400 Subject: fix @compileLog having unintended side effects closes #1459 --- src/ir.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') 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; -- cgit v1.2.3