diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-19 15:18:51 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-19 15:18:51 -0400 |
| commit | e36680d3bd08fceb3e976edeafae60ce6d577342 (patch) | |
| tree | 60ca93229fabd17136dd6aa2389ba9d2c95ed6b7 /src | |
| parent | b588a803bf4493d2fd1892fe172b9ce8cfb0ca30 (diff) | |
| download | zig-e36680d3bd08fceb3e976edeafae60ce6d577342.tar.gz zig-e36680d3bd08fceb3e976edeafae60ce6d577342.zip | |
fix detection of unable to evaluate constant expression
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 2 |
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; |
