aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJoao Moreira <joao.moreira@intel.com>2021-12-07 10:34:37 +0800
committerPhoebe Wang <phoebe.wang@intel.com>2021-12-07 12:10:03 +0800
commitdfcf69770bc522b9e411c66454934a37c1f35332 (patch)
tree8f6801528049a2c886c04881b9896d35101f2826 /clang/lib/Frontend/CompilerInvocation.cpp
parent2bd7384d3a99edd345fcc5e8ee8d550bd65dddb2 (diff)
downloadllvm-dfcf69770bc522b9e411c66454934a37c1f35332.zip
llvm-dfcf69770bc522b9e411c66454934a37c1f35332.tar.gz
llvm-dfcf69770bc522b9e411c66454934a37c1f35332.tar.bz2
[X86] Fix fentry handling in X86IndirectBranchTracking.cpp
When compiling with indirect branch tracking and fentry (-fcf-protection=branch -mfentry -pg) the X86IndirectBranchTrackingPass will attempt to place endbr in basic blocks, checking for Calls/IsCallReturnTwice. For calling the function IsCallReturnTwice(), the pass attempts to retrieve the first operand of the respective machine instruction. Since FENTRY_CALL is considered a call, and it does not have any argument, the condition inside the pass will attempt to call IsCallReturnTwice on the machine instruction, but since it does not have operands, it will lead into a crash. Kudos to Alyssa Milburn for helping in the issue triage. The diff brings a test, but to reproduce the problem, follow the steps below. ``` echo "int main() {};" > repro.c clang repro.c -fcf-protection=branch -mfentry -pg ``` Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D111108
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions