[PATCH] D32895: [ASAN] Insert call to __asan_init and load of dynamic shadow address in correct order

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 11:10:43 PDT 2017


evgeny777 added a comment.

Thanks for looking at it.

Let's assume we have function which *does* have sanitize_address attribute. Now imagine we have function for which both maybeInsertAsanInitAtFunctionEntry and maybeInsertDynamicShadowAtFunctionEntry return true.
If so then:

- Line 2250 (maybeInsertAsanInitAtFunctionEntry) will insert call to __asan_init at the top of our function
- Then Line 2263 (maybeInsertDynamicShadowAtFunctionEntry) will insert load of dynamic shadow address at the top of our function (before __asan_init)

We'll get both things inserted in reverse order (and undefined behavior when running app).


Repository:
  rL LLVM

https://reviews.llvm.org/D32895





More information about the llvm-commits mailing list