From 01de550ef8c1de5cfd880fc2d61121d0089d8b66 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 30 Sep 2020 08:19:05 +0200 Subject: [PATCH] Make predicates private --- .../internal/rangeanalysis/SignAnalysisCommon.qll | 12 ++++++------ .../internal/rangeanalysis/SignAnalysisCommon.qll | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll index bf09dbee83f..64f4a9d10c3 100644 --- a/csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll +++ b/csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll @@ -45,7 +45,7 @@ private Sign certainExprSign(Expr e) { * Gets the value of the expression if it can't be converted to integer, but * can be converted to float. */ -float getNonIntegerValue(ExprWithPossibleValue e) { +private float getNonIntegerValue(ExprWithPossibleValue e) { exists(string s | s = e.getValue() and result = s.toFloat() and @@ -54,7 +54,7 @@ float getNonIntegerValue(ExprWithPossibleValue e) { } /** Holds if the sign of `e` is too complicated to determine. */ -predicate unknownSign(Expr e) { +private predicate unknownSign(Expr e) { not exists(certainExprSign(e)) and ( exists(IntegerLiteral lit | lit = e and not exists(lit.getValue().toInt())) @@ -278,7 +278,7 @@ private Sign implicitSsaDefSign(SsaVariable v) { } /** Gets a possible sign for `f`. */ -Sign fieldSign(Field f) { +private Sign fieldSign(Field f) { if not fieldWithUnknownSign(f) then result = exprSign(getAssignedValueToField(f)) @@ -327,7 +327,7 @@ Sign exprSign(Expr e) { } /** Gets a possible sign for `e` from the signs of its child nodes. */ -Sign specificSubExprSign(Expr e) { +private Sign specificSubExprSign(Expr e) { result = exprSign(getASubExpr(e)) or e = @@ -352,9 +352,9 @@ private predicate binaryOpSigns(Expr e, Sign lhs, Sign rhs) { rhs = binaryOpRhsSign(e) } -Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) } +private Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) } -Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) } +private Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) } /** * Dummy predicate that holds for any sign. This is added to improve readability diff --git a/java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll b/java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll index bf09dbee83f..64f4a9d10c3 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll @@ -45,7 +45,7 @@ private Sign certainExprSign(Expr e) { * Gets the value of the expression if it can't be converted to integer, but * can be converted to float. */ -float getNonIntegerValue(ExprWithPossibleValue e) { +private float getNonIntegerValue(ExprWithPossibleValue e) { exists(string s | s = e.getValue() and result = s.toFloat() and @@ -54,7 +54,7 @@ float getNonIntegerValue(ExprWithPossibleValue e) { } /** Holds if the sign of `e` is too complicated to determine. */ -predicate unknownSign(Expr e) { +private predicate unknownSign(Expr e) { not exists(certainExprSign(e)) and ( exists(IntegerLiteral lit | lit = e and not exists(lit.getValue().toInt())) @@ -278,7 +278,7 @@ private Sign implicitSsaDefSign(SsaVariable v) { } /** Gets a possible sign for `f`. */ -Sign fieldSign(Field f) { +private Sign fieldSign(Field f) { if not fieldWithUnknownSign(f) then result = exprSign(getAssignedValueToField(f)) @@ -327,7 +327,7 @@ Sign exprSign(Expr e) { } /** Gets a possible sign for `e` from the signs of its child nodes. */ -Sign specificSubExprSign(Expr e) { +private Sign specificSubExprSign(Expr e) { result = exprSign(getASubExpr(e)) or e = @@ -352,9 +352,9 @@ private predicate binaryOpSigns(Expr e, Sign lhs, Sign rhs) { rhs = binaryOpRhsSign(e) } -Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) } +private Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) } -Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) } +private Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) } /** * Dummy predicate that holds for any sign. This is added to improve readability