From: Dejan Jevtic Date: Mon, 3 Mar 2014 14:13:37 +0000 (+0000) Subject: mips32: Fix the problem with reading the guest_FCSR register from the wrong guest... X-Git-Tag: svn/VALGRIND_3_10_1^2~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7260acc1975465703a6879fb230f59fa513144df;p=thirdparty%2Fvalgrind.git mips32: Fix the problem with reading the guest_FCSR register from the wrong guest state. When Valgrind isn't executed in mode64, register fcsr need to read from the VexGuestMIPS32State. git-svn-id: svn://svn.valgrind.org/vex/trunk@2832 --- diff --git a/VEX/priv/guest_mips_toIR.c b/VEX/priv/guest_mips_toIR.c index d95d58303e..51e7cfc7ed 100644 --- a/VEX/priv/guest_mips_toIR.c +++ b/VEX/priv/guest_mips_toIR.c @@ -1140,7 +1140,10 @@ static void calculateFCSR(UInt fs, UInt ft, UInt inst, Bool sz32, UInt opN) vex_bzero(&d->fxState, sizeof(d->fxState)); d->fxState[0].fx = Ifx_Read; /* read */ - d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR); + if (mode64) + d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR); + else + d->fxState[0].offset = offsetof(VexGuestMIPS32State, guest_FCSR); d->fxState[0].size = sizeof(UInt); d->fxState[1].fx = Ifx_Read; /* read */ d->fxState[1].offset = floatGuestRegOffset(fs); @@ -1160,7 +1163,10 @@ static void calculateFCSR(UInt fs, UInt ft, UInt inst, Bool sz32, UInt opN) vex_bzero(&d->fxState, sizeof(d->fxState)); d->fxState[0].fx = Ifx_Read; /* read */ - d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR); + if (mode64) + d->fxState[0].offset = offsetof(VexGuestMIPS64State, guest_FCSR); + else + d->fxState[0].offset = offsetof(VexGuestMIPS32State, guest_FCSR); d->fxState[0].size = sizeof(UInt); d->fxState[1].fx = Ifx_Read; /* read */ d->fxState[1].offset = floatGuestRegOffset(fs);