mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
C++: Allow multiple results in getValue
This commit is contained in:
@@ -96,7 +96,7 @@ private float wideningUpperBounds(ArithmeticType t) {
|
||||
* This predicate also handles the case of constant variables initialized in compilation units,
|
||||
* which doesn't necessarily have a getValue() result from the extractor.
|
||||
*/
|
||||
private string getValue0(Expr e) {
|
||||
private string getValue(Expr e) {
|
||||
if exists(e.getValue())
|
||||
then result = e.getValue()
|
||||
else
|
||||
@@ -104,15 +104,10 @@ private string getValue0(Expr e) {
|
||||
e = access and
|
||||
v = access.getTarget() and
|
||||
v.getUnderlyingType().isConst() and
|
||||
result = getValue0(v.getAnAssignedValue())
|
||||
result = getValue(v.getAnAssignedValue())
|
||||
)
|
||||
}
|
||||
|
||||
private string getValue(Expr e) {
|
||||
result = min(getValue0(e)) and
|
||||
result = max(getValue0(e))
|
||||
}
|
||||
|
||||
/** Set of expressions which we know how to analyze. */
|
||||
private predicate analyzableExpr(Expr e) {
|
||||
// The type of the expression must be arithmetic. We reuse the logic in
|
||||
|
||||
Reference in New Issue
Block a user