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) {
185
185
result .getValue ( ) .regexpMatch ( ".*\\s\\s.*" )
186
186
}
187
187
188
+ import codeql.GlobalValueNumbering as GVN
189
+
188
190
/**
189
191
* Gets an expression that repeats the alert-loc as a link.
190
192
*/
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
194
198
exists ( int msgIndex | sel .getExpr ( msgIndex ) = sel .getMessage ( ) |
195
199
result = sel .getExpr ( any ( int i | i > msgIndex ) )
196
200
)
You can’t perform that action at this time.
0 commit comments