Browse Source

* fix for 64-bit shl/shr

git-svn-id: branches/wasm@48268 -
nickysn 4 years ago
parent
commit
6803a111f7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/wasm32/nwasmmat.pas

+ 3 - 1
compiler/wasm32/nwasmmat.pas

@@ -178,11 +178,13 @@ implementation
         location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
         location.register:=hlcg.getintregister(current_asmdata.CurrAsmList,resultdef);
 
 
         thlcgwasm(hlcg).a_load_loc_stack(current_asmdata.CurrAsmList,left.resultdef,left.location);
         thlcgwasm(hlcg).a_load_loc_stack(current_asmdata.CurrAsmList,left.resultdef,left.location);
+        thlcgwasm(hlcg).a_load_loc_stack(current_asmdata.CurrAsmList,right.resultdef,right.location);
+        thlcgwasm(hlcg).resize_stack_int_val(current_asmdata.CurrAsmList,right.resultdef,left.resultdef,false);
         if nodetype=shln then
         if nodetype=shln then
           op:=OP_SHL
           op:=OP_SHL
         else
         else
           op:=OP_SHR;
           op:=OP_SHR;
-        thlcgwasm(hlcg).a_op_loc_stack(current_asmdata.CurrAsmList,op,resultdef,right.location);
+        thlcgwasm(hlcg).a_op_stack(current_asmdata.CurrAsmList,op,resultdef,false);
         thlcgwasm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,resultdef,location.register);
         thlcgwasm(hlcg).a_load_stack_reg(current_asmdata.CurrAsmList,resultdef,location.register);
       end;
       end;