adding support for using llvm ASAN (#5536)

This commit is contained in:
Samantha Marshall 2017-03-14 18:33:56 -04:00 • committed by Andreas Rumpf
commit 93753926f5
2 changed files with 31 additions and 1 deletions

View file

@ -751,7 +751,13 @@ proc gcMark(gch: var GcHeap, p: pointer) {.inline.} =
add(gch.decStack, cell)
sysAssert(allocInv(gch.region), "gcMark end")
proc markStackAndRegisters(gch: var GcHeap) {.noinline, cdecl.} =
#[
This method is conditionally marked with an attribute so that it gets ignored by the LLVM ASAN
(Address SANitizer) intrumentation as it will raise false errors due to the implementation of
garbage collection that is used by Nim. For more information, please see the documentation of
`CLANG_NO_SANITIZE_ADDRESS` in `lib/nimbase.h`.
]#
proc markStackAndRegisters(gch: var GcHeap) {.noinline, cdecl, codegenDecl: "CLANG_NO_SANITIZE_ADDRESS $# $#$#".} =
forEachStackSlot(gch, gcMark)
proc collectZCT(gch: var GcHeap): bool =