Browse Source

* raise an internal error for unexpected subregister types in rgcpu.registertobasictype

git-svn-id: branches/wasm@47717 -
nickysn 4 years ago
parent
commit
1a6f6f6054
1 changed files with 16 additions and 8 deletions
  1. 16 8
      compiler/wasm32/rgcpu.pas

+ 16 - 8
compiler/wasm32/rgcpu.pas

@@ -324,19 +324,27 @@ implementation
       begin
         case getregtype(reg) of
           R_INTREGISTER:
-           if getsubreg(reg)=R_SUBD then
-             registertobastype:=wbt_i32
-           else
-             registertobastype:=wbt_i64;
+            case getsubreg(reg) of
+              R_SUBD:
+                registertobastype:=wbt_i32;
+              R_SUBQ:
+                registertobastype:=wbt_i64;
+              else
+                internalerror(2020120801);
+            end;
 
           R_ADDRESSREGISTER:
             registertobastype:=wbt_i32;
 
           R_FPUREGISTER:
-           if getsubreg(reg)=R_SUBFS then
-             registertobastype:=wbt_f32
-           else
-             registertobastype:=wbt_f64
+            case getsubreg(reg) of
+              R_SUBFS:
+                registertobastype:=wbt_f32;
+              R_SUBFD:
+                registertobastype:=wbt_f64;
+              else
+                internalerror(2020120802);
+            end;
           else
            internalerror(2010122912);
         end;