From af41eee9d1ddc1b0afa3fa297e4f32ef92afe68a Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 18 Jan 2021 22:35:56 +0000 Subject: [PATCH] + support references with only index reg, and no base reg in thlcgwasm.prepare_stack_for_ref git-svn-id: branches/wasm@48179 - --- compiler/wasm32/hlcgcpu.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/wasm32/hlcgcpu.pas b/compiler/wasm32/hlcgcpu.pas index aa6daa86d6..8e47c730da 100644 --- a/compiler/wasm32/hlcgcpu.pas +++ b/compiler/wasm32/hlcgcpu.pas @@ -998,6 +998,12 @@ implementation if (ref.base=NR_EVAL_STACK_BASE) or (ref.base=NR_LOCAL_STACK_POINTER_REG) then exit; + if (ref.base=NR_NO) and (ref.index<>NR_NO) and (ref.scalefactor<=1) then + begin + ref.base:=ref.index; + ref.index:=NR_NO; + end; + // setting up memory offset if assigned(ref.symbol) and (ref.base=NR_NO) and (ref.index=NR_NO) then begin