C++: 'side-effect free'.

This commit is contained in:
Geoffrey White
2021-02-24 09:25:11 +00:00
parent 431a004127
commit 358a8fee7d
3 changed files with 7 additions and 7 deletions

View File

@@ -467,7 +467,7 @@ class Function extends Declaration, ControlFlowNode, AccessHolder, @function {
// ... and likewise for destructors.
this.(Destructor).getADestruction().mayBeGloballyImpure()
else
// Unless it's a function that we know is side-effect-free, it may
// Unless it's a function that we know is side-effect free, it may
// have side-effects.
not this.hasGlobalOrStdName([
"strcmp", "wcscmp", "_mbscmp", "strlen", "wcslen", "_mbslen", "_mbslen_l", "_mbstrlen",

View File

@@ -5,7 +5,7 @@ import semmle.code.cpp.models.interfaces.SideEffect
/**
* A function that operates on strings and is pure. That is, its evaluation is
* guaranteed to be side effect-free.
* guaranteed to be side-effect free.
*/
private class PureStrFunction extends AliasFunction, ArrayFunction, TaintFunction,
SideEffectFunction {
@@ -129,8 +129,8 @@ private class StrLenFunction extends AliasFunction, ArrayFunction, SideEffectFun
}
/**
* A function that is pure, that is, its evaluation is guaranteed to be side
* effect-free. Excludes functions modeled by `PureStrFunction` and `PureMemFunction`.
* A function that is pure, that is, its evaluation is guaranteed to be
* side-effect free. Excludes functions modeled by `PureStrFunction` and `PureMemFunction`.
*/
private class PureFunction extends TaintFunction, SideEffectFunction {
PureFunction() { hasGlobalOrStdOrBslName(["abs", "labs"]) }
@@ -150,7 +150,7 @@ private class PureFunction extends TaintFunction, SideEffectFunction {
/**
* A function that operates on memory buffers and is pure. That is, its
* evaluation is guaranteed to be side effect-free.
* evaluation is guaranteed to be side-effect free.
*/
private class PureMemFunction extends AliasFunction, ArrayFunction, TaintFunction,
SideEffectFunction {