mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
[dfsan] Correctly handle loads and stores of zero size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214561 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1092,6 +1092,11 @@ Value *DFSanFunction::loadShadow(Value *Addr, uint64_t Size, uint64_t Align,
|
||||
|
||||
void DFSanVisitor::visitLoadInst(LoadInst &LI) {
|
||||
uint64_t Size = DFSF.DFS.DL->getTypeStoreSize(LI.getType());
|
||||
if (Size == 0) {
|
||||
DFSF.setShadow(&LI, DFSF.DFS.ZeroShadow);
|
||||
return;
|
||||
}
|
||||
|
||||
uint64_t Align;
|
||||
if (ClPreserveAlignment) {
|
||||
Align = LI.getAlignment();
|
||||
@ -1166,6 +1171,9 @@ void DFSanFunction::storeShadow(Value *Addr, uint64_t Size, uint64_t Align,
|
||||
void DFSanVisitor::visitStoreInst(StoreInst &SI) {
|
||||
uint64_t Size =
|
||||
DFSF.DFS.DL->getTypeStoreSize(SI.getValueOperand()->getType());
|
||||
if (Size == 0)
|
||||
return;
|
||||
|
||||
uint64_t Align;
|
||||
if (ClPreserveAlignment) {
|
||||
Align = SI.getAlignment();
|
||||
|
Reference in New Issue
Block a user