Skip to content

Commit 62c2dc2

Browse files
committed
Check value type for #getArgOperand(int) and remove obsolete throws declaration
1 parent e5eebb6 commit 62c2dc2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/org/sosy_lab/llvm_j/Value.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,10 +1017,11 @@ public List<Integer> getIndices() {
10171017
/**
10181018
* Returns the argument operand at the specified index.
10191019
*
1020-
* @throws LLVMException if this value is not a function call instruction
1020+
* @throws IllegalStateException if this value is not a function call instruction
10211021
* @see #isCallInst()
10221022
*/
1023-
public Value getArgOperand(int index) throws LLVMException {
1023+
public Value getArgOperand(int index) {
1024+
checkLlvmState(isCallInst(), "Value is not a call instruction: " + this);
10241025
int numArgOperands = getNumArgOperands();
10251026
if (numArgOperands <= index) {
10261027
throw new IndexOutOfBoundsException(

0 commit comments

Comments
 (0)