mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[MSan] fix the types of RegSaveAreaPtrPtr and OverflowArgAreaPtrPtr
Despite their names, RegSaveAreaPtrPtr and OverflowArgAreaPtrPtr used to be i8* instead of i8**. This is important, because these pointers are dereferenced twice (first in CreateLoad(), then in getShadowOriginPtr()), but for some reason MSan allowed this - most certainly because it was possible to optimize getShadowOriginPtr() away at compile time. Differential revision: https://reviews.llvm.org/D44520 llvm-svn: 327830
This commit is contained in:
parent
f70485284e
commit
9b92317c0b
@ -3224,7 +3224,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
||||
Value *RegSaveAreaPtrPtr = IRB.CreateIntToPtr(
|
||||
IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
ConstantInt::get(MS.IntptrTy, 16)),
|
||||
Type::getInt64PtrTy(*MS.C));
|
||||
PointerType::get(Type::getInt64PtrTy(*MS.C), 0));
|
||||
Value *RegSaveAreaPtr = IRB.CreateLoad(RegSaveAreaPtrPtr);
|
||||
Value *RegSaveAreaShadowPtr, *RegSaveAreaOriginPtr;
|
||||
unsigned Alignment = 16;
|
||||
@ -3236,7 +3236,7 @@ struct VarArgAMD64Helper : public VarArgHelper {
|
||||
Value *OverflowArgAreaPtrPtr = IRB.CreateIntToPtr(
|
||||
IRB.CreateAdd(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
ConstantInt::get(MS.IntptrTy, 8)),
|
||||
Type::getInt64PtrTy(*MS.C));
|
||||
PointerType::get(Type::getInt64PtrTy(*MS.C), 0));
|
||||
Value *OverflowArgAreaPtr = IRB.CreateLoad(OverflowArgAreaPtrPtr);
|
||||
Value *OverflowArgAreaShadowPtr, *OverflowArgAreaOriginPtr;
|
||||
std::tie(OverflowArgAreaShadowPtr, OverflowArgAreaOriginPtr) =
|
||||
@ -3346,8 +3346,8 @@ struct VarArgMIPS64Helper : public VarArgHelper {
|
||||
IRBuilder<> IRB(OrigInst->getNextNode());
|
||||
Value *VAListTag = OrigInst->getArgOperand(0);
|
||||
Value *RegSaveAreaPtrPtr =
|
||||
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
Type::getInt64PtrTy(*MS.C));
|
||||
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
PointerType::get(Type::getInt64PtrTy(*MS.C), 0));
|
||||
Value *RegSaveAreaPtr = IRB.CreateLoad(RegSaveAreaPtrPtr);
|
||||
Value *RegSaveAreaShadowPtr, *RegSaveAreaOriginPtr;
|
||||
unsigned Alignment = 8;
|
||||
@ -3767,8 +3767,8 @@ struct VarArgPowerPC64Helper : public VarArgHelper {
|
||||
IRBuilder<> IRB(OrigInst->getNextNode());
|
||||
Value *VAListTag = OrigInst->getArgOperand(0);
|
||||
Value *RegSaveAreaPtrPtr =
|
||||
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
Type::getInt64PtrTy(*MS.C));
|
||||
IRB.CreateIntToPtr(IRB.CreatePtrToInt(VAListTag, MS.IntptrTy),
|
||||
PointerType::get(Type::getInt64PtrTy(*MS.C), 0));
|
||||
Value *RegSaveAreaPtr = IRB.CreateLoad(RegSaveAreaPtrPtr);
|
||||
Value *RegSaveAreaShadowPtr, *RegSaveAreaOriginPtr;
|
||||
unsigned Alignment = 8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user