@@ -113,7 +113,7 @@ module LocalFlow {
113113 SsaImpl:: lastRefBeforeRedefExt ( def , bb , i , next .getDefinitionExt ( ) ) and
114114 exprFrom = bb .getNode ( i ) and
115115 exprFrom .getExpr ( ) instanceof VariableReadAccess and
116- exprFrom = [ nodeFrom .asExpr ( ) , nodeFrom .( PostUpdateNode ) .getPreUpdateNode ( ) .asExpr ( ) ]
116+ exprFrom = [ nodeFrom .asExpr ( ) , nodeFrom .( PostUpdateNodeImpl ) .getPreUpdateNode ( ) .asExpr ( ) ]
117117 )
118118 }
119119
@@ -159,7 +159,7 @@ module LocalFlow {
159159 firstReadExt ( def , nodeTo .asExpr ( ) )
160160 or
161161 // Flow from post-update read to next read
162- localSsaFlowStepUseUse ( def , nodeFrom .( PostUpdateNode ) .getPreUpdateNode ( ) , nodeTo )
162+ localSsaFlowStepUseUse ( def , nodeFrom .( PostUpdateNodeImpl ) .getPreUpdateNode ( ) , nodeTo )
163163 or
164164 // Flow into phi (read) SSA definition node from def
165165 localFlowSsaInputFromDef ( nodeFrom , def , nodeTo )
@@ -456,7 +456,7 @@ private predicate splatArgumentAt(CfgNodes::ExprNodes::CallCfgNode c, int pos) {
456456/** A collection of cached types and predicates to be evaluated in the same stage. */
457457cached
458458private module Cached {
459- private import codeql.ruby.typetracking.TypeTrackerSpecific as TypeTrackerSpecific
459+ private import codeql.ruby.typetracking.internal.TypeTrackingImpl
460460
461461 cached
462462 newtype TNode =
@@ -575,14 +575,10 @@ private module Cached {
575575 VariableCapture:: flowInsensitiveStep ( nodeFrom , nodeTo )
576576 }
577577
578+ /** Holds if `n` wraps an SSA definition without ingoing flow. */
578579 private predicate entrySsaDefinition ( SsaDefinitionExtNode n ) {
579- n = LocalFlow:: getParameterDefNode ( _)
580- or
581- exists ( SsaImpl:: DefinitionExt def | def = n .getDefinitionExt ( ) |
582- def instanceof Ssa:: SelfDefinition
583- or
584- def instanceof Ssa:: CapturedEntryDefinition
585- )
580+ n .getDefinitionExt ( ) =
581+ any ( SsaImpl:: WriteDefinition def | not def .( Ssa:: WriteDefinition ) .assigns ( _) )
586582 }
587583
588584 pragma [ nomagic]
@@ -599,6 +595,16 @@ private module Cached {
599595 )
600596 }
601597
598+ private predicate isStoreTargetNode ( Node n ) {
599+ TypeTrackingInput:: storeStep ( _, n , _)
600+ or
601+ TypeTrackingInput:: loadStoreStep ( _, n , _, _)
602+ or
603+ TypeTrackingInput:: withContentStepImpl ( _, n , _)
604+ or
605+ TypeTrackingInput:: withoutContentStepImpl ( _, n , _)
606+ }
607+
602608 cached
603609 predicate isLocalSourceNode ( Node n ) {
604610 n instanceof TSourceParameterNode
@@ -614,11 +620,9 @@ private module Cached {
614620 entrySsaDefinition ( n ) and
615621 not LocalFlow:: localFlowSsaParamInput ( _, n )
616622 or
617- TypeTrackerSpecific:: basicStoreStep ( _, n , _)
618- or
619- TypeTrackerSpecific:: basicLoadStep ( _, n , _)
623+ isStoreTargetNode ( n )
620624 or
621- TypeTrackerSpecific :: basicLoadStoreStep ( _, n , _ , _)
625+ TypeTrackingInput :: loadStep ( _, n , _)
622626 }
623627
624628 cached
@@ -633,7 +637,7 @@ private module Cached {
633637 TElementContentOfTypeContent ( string type , Boolean includeUnknown ) {
634638 type = any ( Content:: KnownElementContent content ) .getIndex ( ) .getValueType ( )
635639 } or
636- TNoContentSet ( ) // Only used by type-tracking
640+ deprecated TNoContentSet ( ) // Only used by type-tracking
637641
638642 cached
639643 class TContentSet =
0 commit comments