aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-01-08 10:54:05 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-01-08 10:54:05 -0500
commit76d0e49e612d661b57b795cd81f5ba06dc26ceca (patch)
treed4b4bc124da5cf8b3e7314a2729a0d051a51279c /src
parente4bc8d22c2f518353d31d8c99de8d35e5ead0c67 (diff)
downloadzig-76d0e49e612d661b57b795cd81f5ba06dc26ceca.tar.gz
zig-76d0e49e612d661b57b795cd81f5ba06dc26ceca.zip
fix unable to eval const expr test case
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 5554e10215..b2842a7473 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -5266,7 +5266,9 @@ static IrInstruction *ir_exec_const_result(IrExecutable *exec) {
if (instruction->id == IrInstructionIdReturn) {
IrInstructionReturn *ret_inst = (IrInstructionReturn *)instruction;
IrInstruction *value = ret_inst->value;
- assert(value->value.special != ConstValSpecialRuntime);
+ if (value->value.special == ConstValSpecialRuntime) {
+ return nullptr;
+ }
return value;
} else if (ir_has_side_effects(instruction)) {
return nullptr;