[compiler-rt][hwasan][fuchsia] Define shadow bound globals

These are required by MemIsShadow for checking if an address actually is shadow memory.

Differential Revision: https://reviews.llvm.org/D105745
This commit is contained in:
Leonard Chan 2021-07-09 15:17:35 -07:00
parent 58aa3881ba
commit b50fb58695
1 changed files with 9 additions and 0 deletions

View File

@ -34,6 +34,15 @@ bool InitShadow() {
__sanitizer::InitShadowBounds();
CHECK_NE(__sanitizer::ShadowBounds.shadow_limit, 0);
// These variables are used by MemIsShadow for asserting we have a correct
// shadow address. On Fuchsia, we only have one region of shadow, so the
// bounds of Low shadow can be zero while High shadow represents the true
// bounds. Note that these are inclusive ranges.
kLowShadowStart = 0;
kLowShadowEnd = 0;
kHighShadowStart = __sanitizer::ShadowBounds.shadow_base;
kHighShadowEnd = __sanitizer::ShadowBounds.shadow_limit - 1;
return true;
}