[KCFI] Emit debugtrap to make indirect call checks recoverable
authorSami Tolvanen <samitolvanen@google.com>
Thu, 1 Jun 2023 23:06:12 +0000 (16:06 -0700)
committerSami Tolvanen <samitolvanen@google.com>
Fri, 2 Jun 2023 19:39:13 +0000 (19:39 +0000)
commit2831a271c8beee7bc0a5b8ea1421de606358207b
tree0244ecddc62934a7c7bb81ebae465fe2136da8c5
parent70fc081f74520fc0809060ecba011773105456d5
[KCFI] Emit debugtrap to make indirect call checks recoverable

KCFI traps should always be recoverable, but as Intrinsic::trap
is marked noreturn, it's not possible to continue execution after
handling the trap as the compiler is free to assume we never
return. Switch to debugtrap instead to ensure we have the option
to resume execution after the trap.
llvm/lib/Transforms/Instrumentation/KCFI.cpp
llvm/test/Transforms/KCFI/kcfi.ll