From 35701f8fa2f826998b56f6a8a67de9e5a17a4174 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 7 Jul 2024 14:49:02 +0300 Subject: [PATCH] * fail with an internal compiler error in case an atomic WebAssembly instruction is generated, while WebAssembly multithreading is disabled --- compiler/wasm32/aasmcpu.pas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/wasm32/aasmcpu.pas b/compiler/wasm32/aasmcpu.pas index 7a4e61abb8..f5ddb08d4a 100644 --- a/compiler/wasm32/aasmcpu.pas +++ b/compiler/wasm32/aasmcpu.pas @@ -147,6 +147,8 @@ uses taicpu = class(tai_cpu_abstract_sym) is_br_generated_by_goto: boolean; + constructor Create(op : tasmop);override; + constructor op_none(op : tasmop); constructor op_reg(op : tasmop;_op1 : tregister); @@ -1910,6 +1912,14 @@ uses taicpu Constructors *****************************************************************************} + constructor taicpu.Create(op: tasmop); + begin + inherited Create(op); + if not (ts_wasm_threads in current_settings.targetswitches) and is_atomic_op(op) then + internalerror(2024070701); + end; + + constructor taicpu.op_none(op : tasmop); begin inherited create(op);