[PATCH] [UBSan] Adding support of MIPS32

Sagar Thakur Sagar.Thakur at imgtec.com
Fri Sep 26 06:24:07 PDT 2014


>>! In D4881#36, @petarj wrote:
> Great. Do you need someone to commit this for you?

Yes, I don't have commit access.

================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.cc:26
@@ -26,2 +25,3 @@
+#if defined(__powerpc__) || defined(__powerpc64__) || defined(__mips__)
   // PCs are always 4 byte aligned.
   return pc - 4;
----------------
petarj wrote:
> While not the subject of this code review, I have to say that the name of this function seems to be wrong. (otherwise, it needs some explanation in a form of a code comment)
> From what I read in the rest of the code, this is used to convert a return-address value into a call-site address, right?
> If that is correct, I am puzzled with the ARM part which does nothing for non-thumb addresses.
> Further, (if my understanding is still correct,) MIPS should follow SPARC case for MIPS32r1/r2, as there is a delay slot to be taken into account.
> Last, just a comment that this code is likely to become more complex with compact branches in MIPS32r6, microMIPS, etc.
I had not considered the delay slot. I have updated it in the new revision.

http://reviews.llvm.org/D4881






More information about the llvm-commits mailing list