diff --git a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll index c84efa44e2d..b9e7d099d3c 100644 --- a/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll +++ b/go/ql/lib/semmle/go/controlflow/ControlFlowGraphShared.qll @@ -859,6 +859,10 @@ module GoCfg { notBlankIdent(assgn.(Go::Assignment).getLhs(j)) or notBlankIdent(assgn.(Go::ValueSpec).getNameExpr(j)) + or + notBlankIdent(assgn.(Go::RangeStmt).getKey()) and j = 0 + or + notBlankIdent(assgn.(Go::RangeStmt).getValue()) and j = 1 ) and result = "assign:" + j.toString() and ord = 2 * j + 1 @@ -1207,21 +1211,22 @@ module GoCfg { or n1.isAfter(s.getDomain()) and n2.isAdditional(s, "[LoopHeader]") or - n1.isAdditional(s, "[LoopHeader]") and + n1.isAdditional(s, "[LoopHeader]") and n2.isAdditional(s, "next") + or + n1.isAdditional(s, "next") and ( - n2.isBefore(s.getKey()) + exists(getFirstEpilogueTag(s)) and n2.isAdditional(s, getFirstEpilogueTag(s)) or - not exists(s.getKey()) and n2.isBefore(s.getBody()) + not exists(getFirstEpilogueTag(s)) and n2.isBefore(s.getBody()) ) or - n1.isAfter(s.getKey()) and - ( - n2.isBefore(s.getValue()) - or - not exists(s.getValue()) and n2.isBefore(s.getBody()) + exists(string tag1, string tag2 | + epilogueSucc(s, tag1, tag2) and + n1.isAdditional(s, tag1) and + n2.isAdditional(s, tag2) ) or - n1.isAfter(s.getValue()) and n2.isBefore(s.getBody()) + n1.isAdditional(s, getLastEpilogueTag(s)) and n2.isBefore(s.getBody()) or n1.isAfter(s.getBody()) and n2.isAdditional(s, "[LoopHeader]") or