diff options
author | Paul Robinson <paul.robinson@sony.com> | 2019-03-06 19:57:43 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2019-03-06 19:57:43 +0000 |
commit | 05efe0fdc472e1f57e36b7f42476946c59c7128b (patch) | |
tree | 1fbea154054205ca47068afd41161285222aee0c /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 05c0afe842cfd54eca4aa870c345bd53e8ce20ce (diff) | |
download | bcm5719-llvm-05efe0fdc472e1f57e36b7f42476946c59c7128b.tar.gz bcm5719-llvm-05efe0fdc472e1f57e36b7f42476946c59c7128b.zip |
[PS4] Emit a trap after a stack-protector fail call.
llvm-svn: 355542
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 33921a2c56d..31768b2f9b2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2537,6 +2537,12 @@ SelectionDAGBuilder::visitSPDescriptorFailure(StackProtectorDescriptor &SPD) { SDValue Chain = TLI.makeLibCall(DAG, RTLIB::STACKPROTECTOR_CHECK_FAIL, MVT::isVoid, None, false, getCurSDLoc(), false, false).second; + // On PS4, the "return address" must still be within the calling function, + // even if it's at the very end, so emit an explicit TRAP here. + // Passing 'true' for doesNotReturn above won't generate the trap for us. + if (TM.getTargetTriple().isPS4CPU()) + Chain = DAG.getNode(ISD::TRAP, getCurSDLoc(), MVT::Other, Chain); + DAG.setRoot(Chain); } |