C++: Only do argument check for

This commit is contained in:
Mathias Vorreiter Pedersen
2020-03-02 16:22:05 +01:00
parent 20529b4436
commit 0b082a4089

View File

@@ -22,13 +22,7 @@ Function viableCallable(CallInstruction call) {
)
or
// Virtual dispatch
result = call.(VirtualDispatch::DataSensitiveCall).resolve() and
(
call.getNumberOfArguments() <= result.getEffectiveNumberOfParameters() and
call.getNumberOfArguments() >= result.getEffectiveNumberOfParameters()
or
result.isVarargs()
)
result = call.(VirtualDispatch::DataSensitiveCall).resolve()
}
/**
@@ -141,6 +135,12 @@ private module VirtualDispatch {
exists(FunctionInstruction fi |
this.flowsFrom(DataFlow::instructionNode(fi), _) and
result = fi.getFunctionSymbol()
) and
(
this.getNumberOfArguments() <= result.getEffectiveNumberOfParameters() and
this.getNumberOfArguments() >= result.getEffectiveNumberOfParameters()
or
result.isVarargs()
)
}
}