mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
getOperandNum(): error if specified operand number is out of range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b92d0cae1
commit
50c997e26a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user