From 2f740fa19ff88981d028289162b3eb469b7f5315 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 4 Nov 2019 09:54:13 +0100 Subject: Fix cmpxchg trying to execute at CT Fixes #3582 --- src/ir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') 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"); } -- cgit v1.2.3