OSDN Git Service

[sancov] Generalize the code to get the previous instruction to multiple architectures
authorGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 10 Oct 2018 00:57:24 +0000 (00:57 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Wed, 10 Oct 2018 00:57:24 +0000 (00:57 +0000)
commit96ce5eaa493b1e9c37eccfa0c8aa58f8a04d0708
tree2b8752d5c729d6484e6b3a5f6defd48c0e67f609
parent42f63b6f964b7f33d207f92ed47d9d8cf96218fd
[sancov] Generalize the code to get the previous instruction to multiple architectures

sancov subtracts one from the address to get the previous instruction,
which makes sense on x86_64, but not on other platforms.
This change ensures that the offset is correct for different platforms.
The logic for computing the offset is copied from sanitizer_common.

Differential Revision: https://reviews.llvm.org/D53039

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344103 91177308-0d34-0410-b5e6-96231b3b80d8
tools/sancov/sancov.cpp