1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

getOperandNum(): error if specified operand number is out of range.

llvm-svn: 28775
This commit is contained in:
Evan Cheng 2006-06-13 21:47:27 +00:00
parent c50df7da72
commit fe3e6e1967

View File

@ -121,6 +121,13 @@ TreePatternNode *SDTypeConstraint::getOperandNum(unsigned OpNo,
assert(NumResults <= 1 &&
"We only work with nodes with zero or one result so far!");
if (OpNo >= (NumResults + N->getNumChildren())) {
std::cerr << "Invalid operand number " << OpNo << " ";
N->dump();
std::cerr << '\n';
exit(1);
}
if (OpNo < NumResults)
return N; // FIXME: need value #
else