Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2187,8 +2187,16 @@ std::pair<Value *, Value *> DFSanFunction::loadShadowFast(
// and then the entire shadow for the second origin pointer (which will be
// chosen by combineOrigins() iff the least-significant half of the wide
// shadow was empty but the other half was not).
Value *WideShadowLo = IRB.CreateShl(
WideShadow, ConstantInt::get(WideShadowTy, WideShadowBitWidth / 2));
Value *WideShadowLo =
F->getParent()->getDataLayout().isLittleEndian()
? IRB.CreateShl(
WideShadow,
ConstantInt::get(WideShadowTy, WideShadowBitWidth / 2))
: IRB.CreateAnd(
WideShadow,
ConstantInt::get(WideShadowTy,
(1 - (1 << (WideShadowBitWidth / 2)))
<< (WideShadowBitWidth / 2)));
Shadows.push_back(WideShadow);
Origins.push_back(DFS.loadNextOrigin(Pos, OriginAlign, &OriginAddr));

Expand Down
Loading