1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

For PR1328:

Use the new parameter on Function::getIntrinsicID to identify cases where
a function is being called with an "llvm." name but it isn't actually an
intrinsic. In such cases generate an error.

llvm-svn: 36121
This commit is contained in:
Reid Spencer 2007-04-16 06:55:42 +00:00
parent f12ab5a55b
commit 408e427abf

View File

@ -2821,6 +2821,14 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
Value *V = getVal(PFTy, $4); // Get the function we're calling...
CHECK_FOR_ERROR
// Check for call to invalid intrinsic to avoid crashing later.
if (Function *theF = dyn_cast<Function>(V)) {
if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&&
!theF->getIntrinsicID(true))
GEN_ERROR("Call to invalid LLVM intrinsic function '" +
theF->getName() + "'");
}
// Check the arguments
ValueList Args;
if ($6->empty()) { // Has no arguments?