[PATCH] D15625: Add iOS/watchOS/tvOS support for ASan (llvm part)

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 14:34:54 PST 2016


samsonov added inline comments.

================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:365
@@ -360,1 +364,3 @@
       Mapping.Offset = kFreeBSD_ShadowOffset32;
+    else if (IsIOS && IsX86)
+      Mapping.Offset = kIOSSimShadowOffset32;
----------------
zaks.anna wrote:
> samsonov wrote:
> > Looks like the order becomes important here. Maybe:
> >   else if (IsIOS)
> >     Mapping.Offset = IsX86 ? kIOSSimShadowOffset32 : kIOSShadowOffset32;
> > here and below? And a comment describing the rationale behind this (I guess, it's just an heuristic, right?)
> >(I guess, it's just an heuristic, right?)
> What do you mean? We are setting the location of the shadow on the device and the simulator (IsIOS and IsX86 -> simulator). The simulator has the host's VM layout. The device has a very different (and restricted) VM layout.
Right, I mean that if we're building for iOS and target x86, you "assume" you're building for ios simulator, but this assumption is not explicitly deducible from the code.


http://reviews.llvm.org/D15625





More information about the llvm-commits mailing list