Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01de550

Browse files
committed
Make predicates private
1 parent f52cf26 commit 01de550

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private Sign certainExprSign(Expr e) {
4545
* Gets the value of the expression if it can't be converted to integer, but
4646
* can be converted to float.
4747
*/
48-
float getNonIntegerValue(ExprWithPossibleValue e) {
48+
private float getNonIntegerValue(ExprWithPossibleValue e) {
4949
exists(string s |
5050
s = e.getValue() and
5151
result = s.toFloat() and
@@ -54,7 +54,7 @@ float getNonIntegerValue(ExprWithPossibleValue e) {
5454
}
5555

5656
/** Holds if the sign of `e` is too complicated to determine. */
57-
predicate unknownSign(Expr e) {
57+
private predicate unknownSign(Expr e) {
5858
not exists(certainExprSign(e)) and
5959
(
6060
exists(IntegerLiteral lit | lit = e and not exists(lit.getValue().toInt()))
@@ -278,7 +278,7 @@ private Sign implicitSsaDefSign(SsaVariable v) {
278278
}
279279

280280
/** Gets a possible sign for `f`. */
281-
Sign fieldSign(Field f) {
281+
private Sign fieldSign(Field f) {
282282
if not fieldWithUnknownSign(f)
283283
then
284284
result = exprSign(getAssignedValueToField(f))
@@ -327,7 +327,7 @@ Sign exprSign(Expr e) {
327327
}
328328

329329
/** Gets a possible sign for `e` from the signs of its child nodes. */
330-
Sign specificSubExprSign(Expr e) {
330+
private Sign specificSubExprSign(Expr e) {
331331
result = exprSign(getASubExpr(e))
332332
or
333333
e =
@@ -352,9 +352,9 @@ private predicate binaryOpSigns(Expr e, Sign lhs, Sign rhs) {
352352
rhs = binaryOpRhsSign(e)
353353
}
354354

355-
Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) }
355+
private Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) }
356356

357-
Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) }
357+
private Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) }
358358

359359
/**
360360
* Dummy predicate that holds for any sign. This is added to improve readability

java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private Sign certainExprSign(Expr e) {
4545
* Gets the value of the expression if it can't be converted to integer, but
4646
* can be converted to float.
4747
*/
48-
float getNonIntegerValue(ExprWithPossibleValue e) {
48+
private float getNonIntegerValue(ExprWithPossibleValue e) {
4949
exists(string s |
5050
s = e.getValue() and
5151
result = s.toFloat() and
@@ -54,7 +54,7 @@ float getNonIntegerValue(ExprWithPossibleValue e) {
5454
}
5555

5656
/** Holds if the sign of `e` is too complicated to determine. */
57-
predicate unknownSign(Expr e) {
57+
private predicate unknownSign(Expr e) {
5858
not exists(certainExprSign(e)) and
5959
(
6060
exists(IntegerLiteral lit | lit = e and not exists(lit.getValue().toInt()))
@@ -278,7 +278,7 @@ private Sign implicitSsaDefSign(SsaVariable v) {
278278
}
279279

280280
/** Gets a possible sign for `f`. */
281-
Sign fieldSign(Field f) {
281+
private Sign fieldSign(Field f) {
282282
if not fieldWithUnknownSign(f)
283283
then
284284
result = exprSign(getAssignedValueToField(f))
@@ -327,7 +327,7 @@ Sign exprSign(Expr e) {
327327
}
328328

329329
/** Gets a possible sign for `e` from the signs of its child nodes. */
330-
Sign specificSubExprSign(Expr e) {
330+
private Sign specificSubExprSign(Expr e) {
331331
result = exprSign(getASubExpr(e))
332332
or
333333
e =
@@ -352,9 +352,9 @@ private predicate binaryOpSigns(Expr e, Sign lhs, Sign rhs) {
352352
rhs = binaryOpRhsSign(e)
353353
}
354354

355-
Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) }
355+
private Sign binaryOpLhsSign(BinaryOperation e) { result = exprSign(e.getLeftOperand()) }
356356

357-
Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) }
357+
private Sign binaryOpRhsSign(BinaryOperation e) { result = exprSign(e.getRightOperand()) }
358358

359359
/**
360360
* Dummy predicate that holds for any sign. This is added to improve readability

0 commit comments

Comments
 (0)