diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-11-04 09:54:13 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2019-11-04 09:54:13 +0100 |
| commit | 2f740fa19ff88981d028289162b3eb469b7f5315 (patch) | |
| tree | e8a4f78bbb908a887fc44f7a9a2c4808a0323274 /src/ir.cpp | |
| parent | 711520d935fd7f6367f1d3a0c2c01c140647b4d0 (diff) | |
| download | zig-2f740fa19ff88981d028289162b3eb469b7f5315.tar.gz zig-2f740fa19ff88981d028289162b3eb469b7f5315.zip | |
Fix cmpxchg trying to execute at CT
Fixes #3582
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index a53367a324..ce0e204e63 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -21798,7 +21798,8 @@ static IrInstruction *ir_analyze_instruction_cmpxchg(IrAnalyze *ira, IrInstructi return ira->codegen->invalid_instruction; } - if (instr_is_comptime(casted_ptr) && instr_is_comptime(casted_cmp_value) && instr_is_comptime(casted_new_value)) { + if (instr_is_comptime(casted_ptr) && casted_ptr->value.data.x_ptr.mut != ConstPtrMutRuntimeVar && + instr_is_comptime(casted_cmp_value) && instr_is_comptime(casted_new_value)) { zig_panic("TODO compile-time execution of cmpxchg"); } |
