diff options
| author | Timon Kruiper <timonkruiper@gmail.com> | 2019-08-24 12:16:46 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-20 13:13:26 -0400 |
| commit | 3b4a6679a6422d68cb1ee4ecd31819b527b01c3b (patch) | |
| tree | 6b85799065ac768d396648e4709378150394cb21 /src/ir.cpp | |
| parent | 695695c852b54c5cdc3f843e5ecd31b4349f2418 (diff) | |
| download | zig-3b4a6679a6422d68cb1ee4ecd31819b527b01c3b.tar.gz zig-3b4a6679a6422d68cb1ee4ecd31819b527b01c3b.zip | |
Fix comptime bitcast inside an expression
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 0c48a2f982..4147fcd599 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -15418,6 +15418,10 @@ static IrInstruction *ir_resolve_result_raw(IrAnalyze *ira, IrInstruction *suspe bitcasted_value = nullptr; } + if (bitcasted_value == nullptr || type_is_invalid(bitcasted_value->value.type)) { + return bitcasted_value; + } + IrInstruction *parent_result_loc = ir_resolve_result(ira, suspend_source_instr, result_bit_cast->parent, dest_type, bitcasted_value, force_runtime, non_null_comptime, true); if (parent_result_loc == nullptr || type_is_invalid(parent_result_loc->value.type) || |
