mirror of
https://github.com/github/codeql.git
synced 2026-04-11 18:14:01 +02:00
Ignore synthesised reads for jump-to-definition
We synthesise variables for things like tuple patterns. For example,
this Ruby code:
a, b = ...
becomes:
__synth__0 = ...
a = __synth__0[0]
b = __synth__0[1]
The `__synth__` variables should be ignored when calculating
jump-to-definition information, since they don't appear in the original
source code.
This commit is contained in:
@@ -43,7 +43,9 @@ newtype DefLoc =
|
||||
exists(Ssa::WriteDefinition w |
|
||||
write = w.getWriteAccess() and
|
||||
read = w.getARead().getExpr() and
|
||||
not read.getLocation() = write.getLocation()
|
||||
not read.getLocation() = write.getLocation() and
|
||||
not read.isSynthesized()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user