Skip to content

Commit 70e53c2

Browse files
committed
SSA: Push includeWriteDefsInFlowStep constraint into newtype.
1 parent ca6444c commit 70e53c2

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

shared/ssa/codeql/ssa/Ssa.qll

+11-9
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,16 @@ module Make<LocationSig Location, InputSig<Location> Input> {
16611661
private newtype TNode =
16621662
TWriteDefSource(WriteDefinition def) { DfInput::ssaDefHasSource(def) } or
16631663
TExprNode(DfInput::Expr e, Boolean isPost) { e = DfInput::getARead(_) } or
1664-
TSsaDefinitionNode(DefinitionExt def) { not phiHasUniqNextNode(def) } or
1664+
TSsaDefinitionNode(DefinitionExt def) {
1665+
not phiHasUniqNextNode(def) and
1666+
if DfInput::includeWriteDefsInFlowStep()
1667+
then any()
1668+
else (
1669+
def instanceof PhiNode or
1670+
def instanceof PhiReadNode or
1671+
DfInput::allowFlowIntoUncertainDef(def)
1672+
)
1673+
} or
16651674
TSsaInputNode(SsaPhiExt phi, BasicBlock input) { relevantPhiInputNode(phi, input) }
16661675

16671676
/**
@@ -1904,14 +1913,7 @@ module Make<LocationSig Location, InputSig<Location> Input> {
19041913
exists(DefinitionExt def |
19051914
nodeFrom.(SsaDefinitionExtNodeImpl).getDefExt() = def and
19061915
def.definesAt(v, bb, i, _) and
1907-
isUseStep = false and
1908-
if DfInput::includeWriteDefsInFlowStep()
1909-
then any()
1910-
else (
1911-
def instanceof PhiNode or
1912-
def instanceof PhiReadNode or
1913-
DfInput::allowFlowIntoUncertainDef(def)
1914-
)
1916+
isUseStep = false
19151917
)
19161918
or
19171919
[nodeFrom, nodeFrom.(ExprPostUpdateNode).getPreUpdateNode()].(ReadNode).readsAt(bb, i, v) and

0 commit comments

Comments
 (0)