@@ -42,29 +42,31 @@ private module Asyncpg {
4242 * Holds if `result` is the result of awaiting `n`.
4343 */
4444 pragma [ inline]
45- DataFlow:: Node awaited ( DataFlow:: Node n ) {
45+ DataFlow:: Node awaited ( DataFlow:: Node awaitedValue ) {
4646 // `await` x
4747 // - `awaitedValue` is `x`
4848 // - `result` is `await x`
4949 exists ( Await await |
5050 result .asExpr ( ) = await and
51- await .getValue ( ) = n .asExpr ( )
51+ await .getValue ( ) = awaitedValue .asExpr ( )
5252 )
5353 or
5454 // `async for x in l`
55- // - `awaitedValue` is `l`
56- // - `result` is `x `
57- exists ( AsyncFor asyncFor |
55+ // - `awaitedValue` is local source of `l`
56+ // - `result` is `l `
57+ exists ( AsyncFor asyncFor , DataFlow :: Node awaited |
5858 result .asExpr ( ) = asyncFor .getTarget ( ) and
59- asyncFor .getIter ( ) = n .asExpr ( )
59+ asyncFor .getIter ( ) = awaited .asExpr ( ) and
60+ awaited .getALocalSource ( ) = awaitedValue
6061 )
6162 or
6263 // `async with x as y`
63- // - `awaitedValue` is `x`
64- // - `result` is `y `
65- exists ( AsyncWith asyncWith |
64+ // - `awaitedValue` is local source of `x`
65+ // - `result` is `x `
66+ exists ( AsyncWith asyncWith , DataFlow :: Node awaited |
6667 result .asExpr ( ) = asyncWith .getContextExpr ( ) and
67- asyncWith .getOptionalVars ( ) = n .asExpr ( )
68+ asyncWith .getOptionalVars ( ) = awaited .asExpr ( ) and
69+ awaited .getALocalSource ( ) = awaitedValue
6870 )
6971 }
7072
0 commit comments