[PATCH] D29586: [lsan] Enable LSan for arm Linux

Yury Gribov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 21:55:46 PST 2017


ygribov 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;
----------------
rengolin wrote:
> 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?
Note that that's how it's done for other cores, including AArch64. All comments is given for x86 internal_clone implementation above (it basically says that this hairy code is inspired by Glibc clone implementation).


Repository:
  rL LLVM

https://reviews.llvm.org/D29586





More information about the llvm-commits mailing list