@@ -490,26 +490,11 @@ private module Cached {
490
490
)
491
491
}
492
492
493
- pragma [ nomagic]
494
- private predicate captureDefReaches ( Definition def , SsaInput:: BasicBlock bb2 , int i2 ) {
495
- variableCapture ( def .getSourceVariable ( ) , _, _, _) and
496
- exists ( SsaInput:: BasicBlock bb1 , int i1 |
497
- Impl:: adjacentDefRead ( def , bb1 , i1 , bb2 , i2 ) and
498
- def .definesAt ( _, bb1 , i1 )
499
- )
500
- or
501
- exists ( SsaInput:: BasicBlock bb3 , int i3 |
502
- captureDefReaches ( def , bb3 , i3 ) and
503
- SsaInput:: variableRead ( bb3 , i3 , _, _) and
504
- Impl:: adjacentDefRead ( def , bb3 , i3 , bb2 , i2 )
505
- )
506
- }
507
-
508
493
/** Holds if `init` is a closure variable that captures the value of `capturedvar`. */
509
494
cached
510
495
predicate captures ( SsaImplicitInit init , SsaVariable capturedvar ) {
511
496
exists ( BasicBlock bb , int i |
512
- captureDefReaches ( capturedvar , bb , i ) and
497
+ Impl :: ssaDefReachesRead ( _ , capturedvar , bb , i ) and
513
498
variableCapture ( capturedvar .getSourceVariable ( ) , init .getSourceVariable ( ) , bb , i )
514
499
)
515
500
}
0 commit comments