[mte] work around lifetime issue with setjmp.
authorFlorian Mayer <fmayer@google.com>
Wed, 2 Feb 2022 00:44:23 +0000 (16:44 -0800)
committerFlorian Mayer <fmayer@google.com>
Wed, 2 Feb 2022 21:55:09 +0000 (13:55 -0800)
commit8680d6db1e45193bd3595f974fa2ef43bb85ca1e
tree958989011ab6e0fac03c5ac265c11bc8212d8470
parent2b0b9b2e836fffa920598ddcde326c2446127c42
[mte] work around lifetime issue with setjmp.

setjmp can return twice, but PostDominatorTree is unaware of this. as
such, it overestimates postdominance, leaving some cases where memory
does not get untagged on return. this causes false positives later in
the program execution.

this is a workaround for now, in the longer term PostDominatorTree
should be made aware of returns_twice, as this may cause problems
elsewhere.

See D118647 for equivalent fix to HWASan.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D118749
llvm/lib/Target/AArch64/AArch64StackTagging.cpp
llvm/test/CodeGen/AArch64/stack-tagging-setjmp.ll [new file with mode: 0644]