[PATCH] D29586: [lsan] Enable LSan for arm Linux
Renato Golin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 13:37:41 PST 2017
rengolin added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1253
+ ((unsigned int *)child_stack)[1] = (uptr)arg;
+ register int r0 __asm__("r0") = flags;
+ register void *r1 __asm__("r1") = child_stack;
----------------
ygribov wrote:
> rengolin wrote:
> > This sequence doesn't coincide with the order of parameters above, and can lead to unexpected results.
> >
> > Why do you need to reserve the registers in this code at all?
> Why should it? The sole purpose of register annotations is to pass arguments to swi call below.
Right, I just realised the compiler will do the necessary moves.
This code is really opaque, can you add some comments like the ones above?
================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1268
+ "bx ip\n"
+#else
+ "ldr lr, [sp], #8\n"
----------------
If this is ARMv4T and no interwork, this will fail, as `blx` was introduced in ARMv5.
Check `compiler-rt/lib/builtins/assembly.h` for more info on the multiple ways to return.
Repository:
rL LLVM
https://reviews.llvm.org/D29586
More information about the llvm-commits
mailing list