Skip to content

Commit 358a8fe

Browse files
committed
C++: 'side-effect free'.
1 parent 431a004 commit 358a8fe

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

cpp/ql/src/semmle/code/cpp/Function.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
467467
// ... and likewise for destructors.
468468
this.(Destructor).getADestruction().mayBeGloballyImpure()
469469
else
470-
// Unless it's a function that we know is side-effect-free, it may
470+
// Unless it's a function that we know is side-effect free, it may
471471
// have side-effects.
472472
not this.hasGlobalOrStdName([
473473
"strcmp", "wcscmp", "_mbscmp", "strlen", "wcslen", "_mbslen", "_mbslen_l", "_mbstrlen",

cpp/ql/src/semmle/code/cpp/models/implementations/Pure.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import semmle.code.cpp.models.interfaces.SideEffect
55

66
/**
77
* A function that operates on strings and is pure. That is, its evaluation is
8-
* guaranteed to be side effect-free.
8+
* guaranteed to be side-effect free.
99
*/
1010
private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunction,
1111
SideEffectFunction {
@@ -129,8 +129,8 @@ private class StrLenFunction extends AliasFunction, ArrayFunction, SideEffectFun
129129
}
130130

131131
/**
132-
* A function that is pure, that is, its evaluation is guaranteed to be side
133-
* effect-free. Excludes functions modeled by `PureStrFunction` and `PureMemFunction`.
132+
* A function that is pure, that is, its evaluation is guaranteed to be
133+
* side-effect free. Excludes functions modeled by `PureStrFunction` and `PureMemFunction`.
134134
*/
135135
private class PureFunction extends TaintFunction, SideEffectFunction {
136136
PureFunction() { hasGlobalOrStdOrBslName(["abs", "labs"]) }
@@ -150,7 +150,7 @@ private class PureFunction extends TaintFunction, SideEffectFunction {
150150

151151
/**
152152
* A function that operates on memory buffers and is pure. That is, its
153-
* evaluation is guaranteed to be side effect-free.
153+
* evaluation is guaranteed to be side-effect free.
154154
*/
155155
private class PureMemFunction extends AliasFunction, ArrayFunction, TaintFunction,
156156
SideEffectFunction {

javascript/ql/src/semmle/javascript/Expr.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class Expr extends @expr, ExprOrStmt, ExprOrType, AST::ValueNode {
115115
predicate isImpure() { any() }
116116

117117
/**
118-
* Holds if this expression is pure, that is, is its evaluation is guaranteed to be
119-
* side effect-free.
118+
* Holds if this expression is pure, that is, is its evaluation is guaranteed
119+
* to be side-effect free.
120120
*/
121121
predicate isPure() { not isImpure() }
122122

0 commit comments

Comments
 (0)