OMG, this is very complex and fragile. Can we find another solution? I'd like to see more discussion at https://code.google.com/p/address-sanitizer/issues/detail?id=330& before looking at the patch in more detail. http://reviews.llvm.org/D5931