Browse Source

* set expectloc correctly in the WASM add node (it is never LOC_FLAGS or LOC_JUMP, but LOC_REGISTER instead)

git-svn-id: branches/wasm@48190 -
nickysn 4 years ago
parent
commit
dbc7cb9001
1 changed files with 9 additions and 0 deletions
  1. 9 0
      compiler/wasm32/nwasmadd.pas

+ 9 - 0
compiler/wasm32/nwasmadd.pas

@@ -48,6 +48,8 @@ interface
           // special treatement for short-boolean expressions
           // using IF block, instead of direct labels
           procedure second_addboolean; override;
+       public
+          function pass_1: tnode;override;
        end;
 
   implementation
@@ -68,6 +70,13 @@ interface
                                tjvmaddnode
 *****************************************************************************}
 
+    function twasmaddnode.pass_1: tnode;
+      begin
+        result:=inherited;
+        if (result=nil) and (expectloc in [LOC_JUMP,LOC_FLAGS]) then
+          expectloc:=LOC_REGISTER;
+      end;
+
     procedure twasmaddnode.pass_left_right;
       begin
         //if not((nodetype in [orn,andn]) and