mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Go: use parseConstantOrRange in parseReturn
This commit is contained in:
@@ -277,13 +277,7 @@ predicate parseReturn(string c, int n) {
|
||||
(
|
||||
c = "ReturnValue" and n = 0
|
||||
or
|
||||
c.regexpCapture("ReturnValue\\[([-0-9]+)\\]", 1).toInt() = n
|
||||
or
|
||||
exists(int n1, int n2 |
|
||||
c.regexpCapture("ReturnValue\\[([-0-9]+)\\.\\.([0-9]+)\\]", 1).toInt() = n1 and
|
||||
c.regexpCapture("ReturnValue\\[([-0-9]+)\\.\\.([0-9]+)\\]", 2).toInt() = n2 and
|
||||
n = [n1 .. n2]
|
||||
)
|
||||
n = parseConstantOrRange(c.regexpCapture("ReturnValue\\[([^\\]]+)\\]", 1))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user