[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Evan Cheng
evan.cheng at apple.com
Thu Dec 14 22:37:23 PST 2006
Changes in directory llvm/include/llvm/Target:
TargetInstrInfo.h updated: 1.109 -> 1.110
---
Log message:
Silly assertion. Forgot variable_ops instructions can have arbitrary number of
operands.
---
Diffs of the changes: (+4 -2)
TargetInstrInfo.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.109 llvm/include/llvm/Target/TargetInstrInfo.h:1.110
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.109 Fri Dec 8 12:44:26 2006
+++ llvm/include/llvm/Target/TargetInstrInfo.h Fri Dec 15 00:37:08 2006
@@ -132,8 +132,10 @@
/// it is set. Returns -1 if it is not set.
int getOperandConstraint(unsigned OpNum,
TOI::OperandConstraint Constraint) const {
- assert(OpNum < numOperands && "Invalid operand # of TargetInstrInfo");
- if (OpInfo[OpNum].Constraints & (1 << Constraint)) {
+ assert((OpNum < numOperands || (Flags & M_VARIABLE_OPS)) &&
+ "Invalid operand # of TargetInstrInfo");
+ if (OpNum < numOperands &&
+ (OpInfo[OpNum].Constraints & (1 << Constraint))) {
unsigned Pos = 16 + Constraint * 4;
return (int)(OpInfo[OpNum].Constraints >> Pos) & 0xf;
}
More information about the llvm-commits
mailing list