diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-12-15 06:37:08 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-12-15 06:37:08 +0000 |
commit | f2f6a1baf78f3bdf375b258996abd567c20496bc (patch) | |
tree | cc799fb6ea44664324db0e10120a869e6203c0c8 /include/llvm/Target/TargetInstrInfo.h | |
parent | 0e51207959df026fb0063b57af24575c24dd5116 (diff) | |
download | external_llvm-f2f6a1baf78f3bdf375b258996abd567c20496bc.zip external_llvm-f2f6a1baf78f3bdf375b258996abd567c20496bc.tar.gz external_llvm-f2f6a1baf78f3bdf375b258996abd567c20496bc.tar.bz2 |
Silly assertion. Forgot variable_ops instructions can have arbitrary number of
operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetInstrInfo.h')
-rw-r--r-- | include/llvm/Target/TargetInstrInfo.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 7fb594d..eb1dbce 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -132,8 +132,10 @@ public: /// 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; } |