Browse Source

* workaround for the raise node generating invalid WebAssembly code for
obtaining the current address. Note that exception handling in WebAssembly
doesn't work. This only fixes the raise node enough to generate valid (but not
correct) WebAssembly code. This is a temporary fix to allow the SysUtils unit
to be compiled. Eventually, exception handling for WebAssembly will need to be
rewritten entirely, in order to make exceptions work properly.

git-svn-id: trunk@49259 -

nickysn 4 years ago
parent
commit
bc42d64348
1 changed files with 5 additions and 4 deletions
  1. 5 4
      compiler/wasm32/nwasmflw.pas

+ 5 - 4
compiler/wasm32/nwasmflw.pas

@@ -217,7 +217,7 @@ implementation
     function twasmraisenode.pass_1 : tnode;
       var
         statements : tstatementnode;
-        current_addr : tlabelnode;
+        //current_addr : tlabelnode;
         raisenode : tcallnode;
       begin
         result:=internalstatements(statements);
@@ -240,9 +240,10 @@ implementation
             else
               begin
                 third:=cinlinenode.create(in_get_frame,false,nil);
-                current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
-                addstatement(statements,current_addr);
-                right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
+                //current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
+                //addstatement(statements,current_addr);
+                //right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
+                right:=cnilnode.create;
 
                 { raise address off by one so we are for sure inside the action area for the raise }
                 if tf_use_psabieh in target_info.flags then