diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-01-08 10:54:05 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-01-08 10:54:05 -0500 |
| commit | 76d0e49e612d661b57b795cd81f5ba06dc26ceca (patch) | |
| tree | d4b4bc124da5cf8b3e7314a2729a0d051a51279c /src/ir.cpp | |
| parent | e4bc8d22c2f518353d31d8c99de8d35e5ead0c67 (diff) | |
| download | zig-76d0e49e612d661b57b795cd81f5ba06dc26ceca.tar.gz zig-76d0e49e612d661b57b795cd81f5ba06dc26ceca.zip | |
fix unable to eval const expr test case
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 4 |
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; |
