@@ -560,7 +560,7 @@ private predicate onlyPossibleReturnOfBool(FuncDecl fd, FunctionOutput res, Node
560560 */
561561predicate possiblyReturnsNonNil ( FuncDecl fd , FunctionOutput res , Node ret ) {
562562 ret = res .getEntryNode ( fd ) and
563- not ret .asExpr ( ) = Builtin :: nil ( ) . getAReference ( )
563+ not exprRefersToNil ( ret .asExpr ( ) )
564564}
565565
566566/**
@@ -570,7 +570,7 @@ predicate possiblyReturnsNonNil(FuncDecl fd, FunctionOutput res, Node ret) {
570570private predicate onlyPossibleReturnOfNonNil ( FuncDecl fd , FunctionOutput res , Node ret ) {
571571 possiblyReturnsNonNil ( fd , res , ret ) and
572572 forall ( Node otherRet | otherRet = res .getEntryNode ( fd ) and otherRet != ret |
573- otherRet .asExpr ( ) = Builtin :: nil ( ) . getAReference ( )
573+ exprRefersToNil ( otherRet .asExpr ( ) )
574574 )
575575}
576576
@@ -609,7 +609,7 @@ private predicate isCertainlyNotNil(DataFlow::Node node) {
609609 */
610610private predicate onlyPossibleReturnOfNil ( FuncDecl fd , FunctionOutput res , DataFlow:: Node ret ) {
611611 ret = res .getEntryNode ( fd ) and
612- ret .asExpr ( ) = Builtin :: nil ( ) . getAReference ( ) and
612+ exprRefersToNil ( ret .asExpr ( ) ) and
613613 forall ( DataFlow:: Node otherRet | otherRet = res .getEntryNode ( fd ) and otherRet != ret |
614614 isCertainlyNotNil ( otherRet )
615615 )
0 commit comments