Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afdd7b0

Browse files
committed
don't compute GVN for string constants of length more than 50, as this results in a infinite loop 😕
1 parent 1fbfcc1 commit afdd7b0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ql/ql/src/codeql/GlobalValueNumbering.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ private predicate classPredicateCallValueNumber(
129129

130130
private predicate literalValueNumber(Literal lit, string value, Type t) {
131131
lit.(String).getValue() = value and
132+
value.length() <= 50 and
132133
t instanceof StringClass
133134
or
134135
lit.(Integer).getValue().toString() = value and

0 commit comments

Comments
 (0)