From 76d0e49e612d661b57b795cd81f5ba06dc26ceca Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 8 Jan 2017 10:54:05 -0500 Subject: fix unable to eval const expr test case --- src/ir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') 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; -- cgit v1.2.3