Browse Source

+ handle any base and no index in the second if case in thlcgwasm.a_loadaddr_ref_reg

git-svn-id: branches/wasm@47944 -
nickysn 4 years ago
parent
commit
e4f4f25c44
1 changed files with 2 additions and 2 deletions
  1. 2 2
      compiler/wasm32/hlcgcpu.pas

+ 2 - 2
compiler/wasm32/hlcgcpu.pas

@@ -1166,9 +1166,9 @@ implementation
           // reading back to the register
           // reading back to the register
           a_load_stack_reg(list, tosize, r);
           a_load_stack_reg(list, tosize, r);
         end
         end
-      else if (ref.base=NR_LOCAL_FRAME_POINTER_REG) and (ref.index=NR_NO) and not assigned(ref.symbol) then
+      else if (ref.base<>NR_NO) and (ref.index=NR_NO) and not assigned(ref.symbol) then
         begin
         begin
-          list.Concat(taicpu.op_reg(a_get_local,NR_LOCAL_FRAME_POINTER_REG));
+          list.Concat(taicpu.op_reg(a_get_local,ref.base));
           list.Concat(taicpu.op_const(a_i32_const, ref.offset));
           list.Concat(taicpu.op_const(a_i32_const, ref.offset));
           // todo: index?
           // todo: index?
           list.Concat(taicpu.op_none(a_i32_add));
           list.Concat(taicpu.op_none(a_i32_add));