mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Shared: check stateful outBarrier as part of pathStep SCC
This commit is contained in:
@@ -2682,6 +2682,7 @@ module MakeImpl<InputSig Lang> {
|
||||
) {
|
||||
not isUnreachableInCall1(node2, cc) and
|
||||
not inBarrier(node2, state) and
|
||||
not outBarrier(node1, state) and
|
||||
(
|
||||
localFlowEntry(node1, pragma[only_bind_into](state)) and
|
||||
(
|
||||
@@ -3757,6 +3758,9 @@ module MakeImpl<InputSig Lang> {
|
||||
|
||||
override NodeEx getNodeEx() { result = node }
|
||||
|
||||
pragma[inline]
|
||||
final NodeEx getNodeExOutgoing() { result = node and not outBarrier(node, state) }
|
||||
|
||||
override FlowState getState() { result = state }
|
||||
|
||||
CallContext getCallContext() { result = cc }
|
||||
@@ -3928,14 +3932,14 @@ module MakeImpl<InputSig Lang> {
|
||||
ap instanceof AccessPathNil
|
||||
)
|
||||
or
|
||||
jumpStepEx(mid.getNodeEx(), node) and
|
||||
jumpStepEx(mid.getNodeExOutgoing(), node) and
|
||||
state = mid.getState() and
|
||||
cc instanceof CallContextAny and
|
||||
sc instanceof SummaryCtxNone and
|
||||
t = mid.getType() and
|
||||
ap = mid.getAp()
|
||||
or
|
||||
additionalJumpStep(mid.getNodeEx(), node) and
|
||||
additionalJumpStep(mid.getNodeExOutgoing(), node) and
|
||||
state = mid.getState() and
|
||||
cc instanceof CallContextAny and
|
||||
sc instanceof SummaryCtxNone and
|
||||
@@ -3943,7 +3947,7 @@ module MakeImpl<InputSig Lang> {
|
||||
t = node.getDataFlowType() and
|
||||
ap = TAccessPathNil()
|
||||
or
|
||||
additionalJumpStateStep(mid.getNodeEx(), mid.getState(), node, state) and
|
||||
additionalJumpStateStep(mid.getNodeExOutgoing(), mid.getState(), node, state) and
|
||||
cc instanceof CallContextAny and
|
||||
sc instanceof SummaryCtxNone and
|
||||
mid.getAp() instanceof AccessPathNil and
|
||||
@@ -3978,7 +3982,7 @@ module MakeImpl<InputSig Lang> {
|
||||
) {
|
||||
ap0 = mid.getAp() and
|
||||
c = ap0.getHead() and
|
||||
Stage5::readStepCand(mid.getNodeEx(), c, node) and
|
||||
Stage5::readStepCand(mid.getNodeExOutgoing(), c, node) and
|
||||
state = mid.getState() and
|
||||
cc = mid.getCallContext()
|
||||
}
|
||||
@@ -3991,7 +3995,7 @@ module MakeImpl<InputSig Lang> {
|
||||
exists(DataFlowType contentType |
|
||||
t0 = mid.getType() and
|
||||
ap0 = mid.getAp() and
|
||||
Stage5::storeStepCand(mid.getNodeEx(), _, c, node, contentType, t) and
|
||||
Stage5::storeStepCand(mid.getNodeExOutgoing(), _, c, node, contentType, t) and
|
||||
state = mid.getState() and
|
||||
cc = mid.getCallContext() and
|
||||
compatibleTypes(t0, contentType)
|
||||
@@ -4009,7 +4013,8 @@ module MakeImpl<InputSig Lang> {
|
||||
not outBarrier(retNode, state) and
|
||||
innercc = mid.getCallContext() and
|
||||
innercc instanceof CallContextNoCall and
|
||||
apa = mid.getAp().getApprox()
|
||||
apa = mid.getAp().getApprox() and
|
||||
not outBarrier(retNode, state)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4130,7 +4135,8 @@ module MakeImpl<InputSig Lang> {
|
||||
pathNode(_, ret, state, cc, sc, t, ap, _) and
|
||||
kind = ret.getKind() and
|
||||
apa = ap.getApprox() and
|
||||
parameterFlowThroughAllowed(sc.getParamNode(), kind)
|
||||
parameterFlowThroughAllowed(sc.getParamNode(), kind) and
|
||||
not outBarrier(ret, state)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user