Bug 1513725 - fix xptcall stubs for aarch64 for bool params, r?froydnj draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 22 Jan 2019 13:02:59 +0000
changeset 1816206 75be133c679c0b60b2c49aaf54866712770f20c0
parent 1814911 666abafd77b1e8a5e8cb83824480ed99635f9684
child 1816207 583a53141c7edb2da2ff0194c4c86302da9a678f
push id328880
push usergijskruitbosch@gmail.com
push dateTue, 22 Jan 2019 13:05:30 +0000
treeherdertry@583a53141c7e [default view] [failures only]
reviewersfroydnj
bugs1513725
milestone66.0a1
Bug 1513725 - fix xptcall stubs for aarch64 for bool params, r?froydnj
xpcom/reflect/xptcall/md/unix/xptcstubs_aarch64.cpp
xpcom/reflect/xptcall/md/win32/xptcstubs_aarch64.cpp
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_aarch64.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_aarch64.cpp
@@ -147,19 +147,19 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                     memcpy(&dp->val.d, &fprData[next_fpr++], sizeof(dp->val.d));
                 } else {
                     memcpy(&dp->val.d, ap++, sizeof(dp->val.d));
                 }
                 break;
 
             case nsXPTType::T_BOOL:
                 if (next_gpr < PARAM_GPR_COUNT) {
-                    dp->val.b  = (bool)gprData[next_gpr++];
+                    dp->val.b  = (bool)(uint8_t)gprData[next_gpr++];
                 } else {
-                    dp->val.b  = (bool)*ap++;
+                    dp->val.b  = (bool)(uint8_t)*ap++;
                 }
                 break;
 
             case nsXPTType::T_CHAR:
                 if (next_gpr < PARAM_GPR_COUNT) {
                     dp->val.c  = (char)gprData[next_gpr++];
                 } else {
                     dp->val.c  = (char)*ap++;
--- a/xpcom/reflect/xptcall/md/win32/xptcstubs_aarch64.cpp
+++ b/xpcom/reflect/xptcall/md/win32/xptcstubs_aarch64.cpp
@@ -145,19 +145,19 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                     memcpy(&dp->val.d, &fprData[next_fpr++], sizeof(dp->val.d));
                 } else {
                     memcpy(&dp->val.d, ap++, sizeof(dp->val.d));
                 }
                 break;
 
             case nsXPTType::T_BOOL:
                 if (next_gpr < PARAM_GPR_COUNT) {
-                    dp->val.b  = (bool)gprData[next_gpr++];
+                    dp->val.b  = (bool)(uint8_t)gprData[next_gpr++];
                 } else {
-                    dp->val.b  = (bool)*ap++;
+                    dp->val.b  = (bool)(uint8_t)*ap++;
                 }
                 break;
 
             case nsXPTType::T_CHAR:
                 if (next_gpr < PARAM_GPR_COUNT) {
                     dp->val.c  = (char)gprData[next_gpr++];
                 } else {
                     dp->val.c  = (char)*ap++;