Skip to content

Commit 933e01b

Browse files
committed
Remove redundant code
The case of a CallExpr is actually covered by the next disjunct. Note that the CallExpr case had a subtle bug: `c.getTarget()` is not defined when we are calling a variable. Better to use `c.getCalleeType()`. But in this case we can just delete the code.
1 parent 7da1ade commit 933e01b

File tree

1 file changed

+0
-4
lines changed
  • go/ql/lib/semmle/go/controlflow

1 file changed

+0
-4
lines changed

go/ql/lib/semmle/go/controlflow/IR.qll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,6 @@ module IR {
718718
predicate extractsElement(Instruction base, int idx) { base = this.getBase() and idx = i }
719719

720720
override Type getResultType() {
721-
exists(CallExpr c | this.getBase() = evalExprInstruction(c) |
722-
result = c.getTarget().getResultType(i)
723-
)
724-
or
725721
exists(Expr e | this.getBase() = evalExprInstruction(e) |
726722
result = e.getType().(TupleType).getComponentType(pragma[only_bind_into](i))
727723
)

0 commit comments

Comments
 (0)