]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fill in a (very) few cases for get_otrack_shadow_offset_wrk on arm64.
authorJulian Seward <jseward@acm.org>
Thu, 27 Feb 2014 11:15:58 +0000 (11:15 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 27 Feb 2014 11:15:58 +0000 (11:15 +0000)
Apparently needed for generating some kinds of error messages, even
when not doing origin tracking, strangely enough.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13841

memcheck/mc_machine.c

index d04d542d14ee7054a85c8ec89f4b0576f65d4d09..06807cc4b43dfa6ea5f4cc99c3c638a6da00a0b1 100644 (file)
@@ -971,11 +971,17 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
 #  define SZB(_fieldname) \
       (sizeof(((VexGuestARM64State*)0)->guest_##_fieldname))
 
-   Int  o     = offset;
-   Int  sz    = szB;
+   Int  o    = offset;
+   Int  sz   = szB;
+   Bool is48 = sz == 8 || sz == 4;
+
    tl_assert(sz > 0);
    tl_assert(host_is_little_endian());
-   (void)o; // RMME -- just to stop gcc warning that o is unused
+
+   if (o == GOF(X0)  && is48) return o;
+   if (o == GOF(X1)  && is48) return o;
+   if (o == GOF(X2)  && is48) return o;
+   if (o == GOF(X3)  && is48) return o;
 
    VG_(printf)("MC_(get_otrack_shadow_offset)(arm64)(off=%d,sz=%d)\n",
                offset,szB);