From 2e77e1a47178ee197608c6841982a9c6a3c82f52 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 2 Feb 2025 16:26:42 +0200 Subject: [PATCH] * WebAssembly codegen: fixed access to absolute variables, pointing to just a constant address, e.g. var a: longint absolute 5; --- compiler/wasm32/hlcgcpu.pas | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/wasm32/hlcgcpu.pas b/compiler/wasm32/hlcgcpu.pas index 04670d2e73..47aed338a1 100644 --- a/compiler/wasm32/hlcgcpu.pas +++ b/compiler/wasm32/hlcgcpu.pas @@ -1319,12 +1319,10 @@ implementation end else begin - { static field -> nothing to do here, except for validity check } - {if not assigned(ref.symbol) or - (ref.offset<>0) then - begin - internalerror(2010120525); - end;} + { no symbol, no index, just fixed address, e.g. var a: longint absolute 5; } + list.Concat(taicpu.op_const(a_i32_const,0)); + incstack(list,1); + result:=1; end; end;