aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp2
1 files changed, 1 insertions, 1 deletions
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;