Browse Source

* fixed getting the address of a global variable

git-svn-id: branches/wasm@47168 -
nickysn 4 years ago
parent
commit
8211bcbd4c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compiler/wasm32/hlcgcpu.pas

+ 3 - 3
compiler/wasm32/hlcgcpu.pas

@@ -1139,12 +1139,12 @@ implementation
       { only allowed for types that are not implicit pointers in Pascal (in
       { only allowed for types that are not implicit pointers in Pascal (in
         that case, ref contains a pointer to the actual data and we simply
         that case, ref contains a pointer to the actual data and we simply
         return that pointer) }
         return that pointer) }
-      if not wasmAlwayInMem(fromsize) then
-        internalerror(2010120534);
+      //if not wasmAlwayInMem(fromsize) then
+      //  internalerror(2010120534);
 
 
       if assigned(ref.symbol) then begin
       if assigned(ref.symbol) then begin
         // pushing address on stack
         // pushing address on stack
-        list.Concat(taicpu.op_ref(a_get_global, ref));
+        list.Concat(taicpu.op_ref(a_i32_const, ref));
         incstack(list, 1);
         incstack(list, 1);
         // reading back to the register
         // reading back to the register
         a_load_stack_reg(list, tosize, r);
         a_load_stack_reg(list, tosize, r);