mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Ruby: Fix regex parsing of /[|]/
This commit is contained in:
@@ -861,6 +861,7 @@ abstract class RegExp extends AST::StringlikeLiteral {
|
||||
* Whether the text in the range start,end is an alternation
|
||||
*/
|
||||
predicate alternation(int start, int end) {
|
||||
not this.inCharSet(start) and
|
||||
this.topLevel(start, end) and
|
||||
exists(int less | this.subalternation(start, less, _) and less < end)
|
||||
}
|
||||
|
||||
@@ -181,11 +181,8 @@ regexp.rb:
|
||||
# 26| [RegExpConstant, RegExpNormalChar] -
|
||||
|
||||
# 27| [RegExpCharacterClass] [|]
|
||||
#-----| 0 -> [RegExpAlt] |
|
||||
#-----| 0 -> [RegExpConstant, RegExpNormalChar] |
|
||||
|
||||
# 27| [RegExpAlt] |
|
||||
|
||||
# 27| [RegExpConstant, RegExpNormalChar] |
|
||||
|
||||
# 30| [RegExpCharacterClass] [[a-f]
|
||||
|
||||
Reference in New Issue
Block a user