diff options
-rw-r--r-- | lib/VMCore/Verifier.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index a40d197aa2..cbb34f09e4 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -377,6 +377,10 @@ void Verifier::visitFunction(Function &F) { if (Attrs->paramHasAttr(Idx, ParamAttr::ByVal)) { Assert1(isa<PointerType>(FT->getParamType(Idx-1)), "Attribute ByVal should only apply to pointer to structs!", &F); + + Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::StructRet), + "Attributes ByVal and StructRet are incompatible!", &F); + const PointerType *Ty = cast<PointerType>(FT->getParamType(Idx-1)); Assert1(isa<StructType>(Ty->getElementType()), |