[PATCH] [UBSan] Adding support of MIPS32
petarj at mips.com
Mon Aug 25 07:50:10 PDT 2014
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;
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.
More information about the llvm-commits