Skip to content

Commit

Permalink
Use FrameIndexTy for stack protector
Browse files Browse the repository at this point in the history
Using getValueType() is not correct for architectures extended with CHERI since
we need a pointer type and not the value that is loaded. While stack
protector is useless when you have CHERI (since CHERI provides much
stronger security guarantees), we still have a test to check that we can
generate correct code for checks. Merging b281138
into our tree broke this test. Fix by using TLI.getFrameIndexTy().

Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D77785
  • Loading branch information
arichardson committed Apr 23, 2020
1 parent 1222416 commit bbcfce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Expand Up @@ -6360,7 +6360,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,

int FI = FuncInfo.StaticAllocaMap[Slot];
MFI.setStackProtectorIndex(FI);
EVT PtrTy = Src.getValueType();
EVT PtrTy = TLI.getFrameIndexTy(DAG.getDataLayout());

SDValue FIN = DAG.getFrameIndex(FI, PtrTy);

Expand Down

0 comments on commit bbcfce4

Please sign in to comment.