mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Parameter.qll: Tweak how effective declaration entries are computed
With the new formulation, we can join on function and index at the same time, leading to significant performance gains on large code bases that use templates extensively.
This commit is contained in:
@@ -68,10 +68,9 @@ class Parameter extends LocalScopeVariable, @parameter {
|
||||
*/
|
||||
private VariableDeclarationEntry getAnEffectiveDeclarationEntry() {
|
||||
if getFunction().isConstructedFrom(_)
|
||||
then exists (Parameter prototype
|
||||
| prototype = result.getVariable() and
|
||||
prototype.getIndex() = getIndex() and
|
||||
getFunction().isConstructedFrom(prototype.getFunction()))
|
||||
then exists (Function prototypeInstantiation
|
||||
| prototypeInstantiation.getParameter(getIndex()) = result.getVariable() and
|
||||
getFunction().isConstructedFrom(prototypeInstantiation))
|
||||
else result = getADeclarationEntry()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user