mirror of
https://github.com/github/codeql.git
synced 2026-06-03 04:40:14 +02:00
Fix lit-init nodes
There was a loop in the definitions which meant nothing ever got made
This commit is contained in:
@@ -1153,9 +1153,18 @@ module GoCfg {
|
||||
not exists(lit.getElement(_)) and n2.isAfter(lit)
|
||||
)
|
||||
or
|
||||
// After element → lit-init → next element or After
|
||||
// After element → optional lit-index → lit-init → next element or After
|
||||
exists(int i |
|
||||
n1.isAfter(lit.getElement(i)) and n2.isAdditional(lit.getElement(i), "lit-init")
|
||||
n1.isAfter(lit.getElement(i)) and
|
||||
(
|
||||
n2.isAdditional(lit.getElement(i), "lit-index")
|
||||
or
|
||||
not exists(PreControlFlowNode idx | idx.isAdditional(lit.getElement(i), "lit-index")) and
|
||||
n2.isAdditional(lit.getElement(i), "lit-init")
|
||||
)
|
||||
or
|
||||
n1.isAdditional(lit.getElement(i), "lit-index") and
|
||||
n2.isAdditional(lit.getElement(i), "lit-init")
|
||||
or
|
||||
n1.isAdditional(lit.getElement(i), "lit-init") and
|
||||
(
|
||||
|
||||
@@ -1226,7 +1226,9 @@ module IR {
|
||||
)
|
||||
} or
|
||||
/** A composite literal element target. */
|
||||
MkLiteralElementTarget(InitLiteralComponentInstruction elt) or
|
||||
MkLiteralElementTarget(ControlFlow::Node write) {
|
||||
write.isAdditional(any(CompositeLit lit).getAnElement(), "lit-init")
|
||||
} or
|
||||
/** A result variable write target. */
|
||||
MkResultWriteTarget(WriteResultInstruction w)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user