From 1a6f6f605497d8a3e76c2193a1b873287e375942 Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 8 Dec 2020 07:26:08 +0000 Subject: [PATCH] * raise an internal error for unexpected subregister types in rgcpu.registertobasictype git-svn-id: branches/wasm@47717 - --- compiler/wasm32/rgcpu.pas | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/compiler/wasm32/rgcpu.pas b/compiler/wasm32/rgcpu.pas index ee4a90fe00..7f8282d0a8 100644 --- a/compiler/wasm32/rgcpu.pas +++ b/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;