File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
ruby/ql/lib/codeql/ruby/controlflow/internal Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -696,11 +696,24 @@ module Trees {
696
696
}
697
697
}
698
698
699
- private class AsPatternTree extends StandardPreOrderTree , AsPattern {
700
- override ControlFlowTree getChildElement ( int i ) {
701
- result = this .getPattern ( ) and i = 0
699
+ private class AsPatternTree extends PreOrderTree , AsPattern {
700
+ final override predicate propagatesAbnormal ( AstNode child ) { child = this .getPattern ( ) }
701
+
702
+ final override predicate last ( AstNode last , Completion c ) {
703
+ last ( this .getPattern ( ) , last , c ) and
704
+ c .( MatchingCompletion ) .getValue ( ) = false
705
+ or
706
+ last ( this .getVariableAccess ( ) , last , c )
707
+ }
708
+
709
+ final override predicate succ ( AstNode pred , AstNode succ , Completion c ) {
710
+ pred = this and
711
+ first ( this .getPattern ( ) , succ ) and
712
+ c instanceof SimpleCompletion
702
713
or
703
- result = this .getVariableAccess ( ) and i = 1
714
+ last ( this .getPattern ( ) , pred , c ) and
715
+ first ( this .getVariableAccess ( ) , succ ) and
716
+ c .( MatchingCompletion ) .getValue ( ) = true
704
717
}
705
718
}
706
719
You can’t perform that action at this time.
0 commit comments