File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -185,12 +185,16 @@ String doubleWhitespace(Select sel) {
185185 result .getValue ( ) .regexpMatch ( ".*\\s\\s.*" )
186186}
187187
188+ import codeql.GlobalValueNumbering as GVN
189+
188190/**
189191 * Gets an expression that repeats the alert-loc as a link.
190192 */
191- VarAccess getAlertLocLink ( Select sel ) {
192- // TODO: Get this to work with GVN. I got an infinite loop when I tried.
193- result = sel .getExpr ( 0 ) .( VarAccess ) .getDeclaration ( ) .getAnAccess ( ) and
193+ AstNode getAlertLocLink ( Select sel ) {
194+ exists ( GVN:: ValueNumber vn |
195+ result = vn .getAnExpr ( ) and
196+ sel .getExpr ( 0 ) = vn .getAnExpr ( )
197+ ) and
194198 exists ( int msgIndex | sel .getExpr ( msgIndex ) = sel .getMessage ( ) |
195199 result = sel .getExpr ( any ( int i | i > msgIndex ) )
196200 )
You can’t perform that action at this time.
0 commit comments