mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Assert to bounds check MDNode::getOperand.
The getOperandPtr utility already bounds checks, but allows one-off-the-end. This assert should catch the cases that could previously have been dereferencing these one-off-the-end pointer. Happily, no cases of this came up with this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176721 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9333ffb6db
commit
eda774a6c6
@ -303,6 +303,7 @@ void MDNode::deleteTemporary(MDNode *N) {
|
||||
|
||||
/// getOperand - Return specified operand.
|
||||
Value *MDNode::getOperand(unsigned i) const {
|
||||
assert(i < getNumOperands() && "Invalid operand number");
|
||||
return *getOperandPtr(const_cast<MDNode*>(this), i);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user