From e36680d3bd08fceb3e976edeafae60ce6d577342 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 19 Jun 2019 15:18:51 -0400 Subject: fix detection of unable to evaluate constant expression --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 3d125da1a1..6dfaa168ec 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8647,7 +8647,7 @@ static ConstExprValue *ir_exec_const_result(CodeGen *codegen, IrExecutable *exec return &codegen->invalid_instruction->value; } return &value->value; - } else if (ir_has_side_effects(instruction)) { + } else if (ir_has_side_effects(instruction) && !instr_is_comptime(instruction)) { exec_add_error_node(codegen, exec, instruction->source_node, buf_sprintf("unable to evaluate constant expression")); return &codegen->invalid_instruction->value; -- cgit v1.2.3