From 76cf8d165942d0c262effdebccf971cc3bf8d5b4 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Thu, 12 May 2022 14:28:26 +0100 Subject: [PATCH] C++: fix typos in comments --- cpp/ql/lib/semmle/code/cpp/Field.qll | 2 +- cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll | 2 +- .../semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll | 2 +- .../code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll | 2 +- .../lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll | 2 +- cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll | 2 +- .../cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll | 2 +- .../implementation/aliased_ssa/internal/SSAConstruction.qll | 2 +- .../code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll | 2 +- .../ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll | 2 +- .../implementation/unaliased_ssa/internal/SSAConstruction.qll | 2 +- cpp/ql/lib/semmle/code/cpp/security/Encryption.qll | 2 +- cpp/ql/src/Diagnostics/ExtractionProblems.qll | 4 ++-- cpp/ql/src/Diagnostics/Internal/ExtractionErrors.qll | 4 ++-- cpp/ql/src/Security/CWE/CWE-611/XXE.ql | 2 +- cpp/ql/test/TestUtilities/InlineExpectationsTest.qll | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Field.qll b/cpp/ql/lib/semmle/code/cpp/Field.qll index 362569708a4..95e55568c4b 100644 --- a/cpp/ql/lib/semmle/code/cpp/Field.qll +++ b/cpp/ql/lib/semmle/code/cpp/Field.qll @@ -31,7 +31,7 @@ class Field extends MemberVariable { int getByteOffset() { fieldoffsets(underlyingElement(this), result, _) } /** - * Gets the byte offset within `mostDerivedClass` of each occurence of this + * Gets the byte offset within `mostDerivedClass` of each occurrence of this * field within `mostDerivedClass` itself or a base class subobject of * `mostDerivedClass`. * Note that for fields of virtual base classes, and non-virtual base classes diff --git a/cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll b/cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll index 96f03c931bf..124c00f10e3 100644 --- a/cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll +++ b/cpp/ql/lib/semmle/code/cpp/controlflow/internal/CFG.qll @@ -953,7 +953,7 @@ private predicate subEdge(Pos p1, Node n1, Node n2, Pos p2) { private predicate subEdgeIncludingDestructors(Pos p1, Node n1, Node n2, Pos p2) { subEdge(p1, n1, n2, p2) or - // If `n1` has sub-nodes to accomodate destructors, but there are none to be + // If `n1` has sub-nodes to accommodate destructors, but there are none to be // called, connect the "before destructors" node directly to the "after // destructors" node. For performance, only do this when the nodes exist. exists(Pos afterDtors | afterDtors.isAfterDestructors() | subEdge(afterDtors, n1, _, _)) and diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll index e60505d9248..0079b259260 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll @@ -305,7 +305,7 @@ cached private module Cached { /** * If needed, call this predicate from `DataFlowImplSpecific.qll` in order to - * force a stage-dependency on the `DataFlowImplCommon.qll` stage and therby + * force a stage-dependency on the `DataFlowImplCommon.qll` stage and thereby * collapsing the two stages. */ cached diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll index e60505d9248..0079b259260 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImplCommon.qll @@ -305,7 +305,7 @@ cached private module Cached { /** * If needed, call this predicate from `DataFlowImplSpecific.qll` in order to - * force a stage-dependency on the `DataFlowImplCommon.qll` stage and therby + * force a stage-dependency on the `DataFlowImplCommon.qll` stage and thereby * collapsing the two stages. */ cached diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll index ac7466779fe..4171f5a5227 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll @@ -37,7 +37,7 @@ private module Cached { * along the chain of addresses computed by `StoreNodeInstr.getInner` to identify field writes * and call `storeStep` accordingly (i.e., for an expression like `a.b.c = x`, we visit `c`, then * `b`, then `a`). - * 2. Flow is transfered from a `WriteSideEffectInstruction` to a `StoreNodeOperand` after flow + * 2. Flow is transferred from a `WriteSideEffectInstruction` to a `StoreNodeOperand` after flow * returns to a caller. Flow will then proceed to the defining instruction of the operand (because * the `StoreNodeInstr` computed by `StoreNodeOperand.getInner()` is the `StoreNode` containing * the defining instruction), and then along the chain computed by `StoreNodeInstr.getInner` like diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll index 32e36bb6787..91e1fe03e23 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/EdgeKind.qll @@ -67,7 +67,7 @@ class DefaultEdge extends EdgeKind, TDefaultEdge { /** * A "case" edge, representing the successor of a `Switch` instruction when the - * the condition value matches a correponding `case` label. + * the condition value matches a corresponding `case` label. */ class CaseEdge extends EdgeKind, TCaseEdge { string minValue; diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll index 796fb792366..ca3c378cd7e 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/ValueNumbering.qll @@ -34,7 +34,7 @@ class ValueNumber extends TValueNumber { final Instruction getAnInstruction() { this = valueNumber(result) } /** - * Gets one of the instructions that was assigned this value number. The chosen instuction is + * Gets one of the instructions that was assigned this value number. The chosen instruction is * deterministic but arbitrary. Intended for use only in debugging. */ final Instruction getExampleInstruction() { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll index 13ec2ca4ca4..303a9683011 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll @@ -1005,7 +1005,7 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) { deprecated predicate canReuseSSAForMemoryResult = canReuseSsaForMemoryResult/1; /** - * Expose some of the internal predicates to PrintSSA.qll. We do this by publically importing those modules in the + * Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the * `DebugSSA` module, which is then imported by PrintSSA. */ module DebugSsa { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll index 796fb792366..ca3c378cd7e 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/gvn/ValueNumbering.qll @@ -34,7 +34,7 @@ class ValueNumber extends TValueNumber { final Instruction getAnInstruction() { this = valueNumber(result) } /** - * Gets one of the instructions that was assigned this value number. The chosen instuction is + * Gets one of the instructions that was assigned this value number. The chosen instruction is * deterministic but arbitrary. Intended for use only in debugging. */ final Instruction getExampleInstruction() { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll index 796fb792366..ca3c378cd7e 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/gvn/ValueNumbering.qll @@ -34,7 +34,7 @@ class ValueNumber extends TValueNumber { final Instruction getAnInstruction() { this = valueNumber(result) } /** - * Gets one of the instructions that was assigned this value number. The chosen instuction is + * Gets one of the instructions that was assigned this value number. The chosen instruction is * deterministic but arbitrary. Intended for use only in debugging. */ final Instruction getExampleInstruction() { diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll index 13ec2ca4ca4..303a9683011 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll @@ -1005,7 +1005,7 @@ predicate canReuseSsaForMemoryResult(Instruction instruction) { deprecated predicate canReuseSSAForMemoryResult = canReuseSsaForMemoryResult/1; /** - * Expose some of the internal predicates to PrintSSA.qll. We do this by publically importing those modules in the + * Expose some of the internal predicates to PrintSSA.qll. We do this by publicly importing those modules in the * `DebugSSA` module, which is then imported by PrintSSA. */ module DebugSsa { diff --git a/cpp/ql/lib/semmle/code/cpp/security/Encryption.qll b/cpp/ql/lib/semmle/code/cpp/security/Encryption.qll index 120b154b787..00be9a3deb5 100644 --- a/cpp/ql/lib/semmle/code/cpp/security/Encryption.qll +++ b/cpp/ql/lib/semmle/code/cpp/security/Encryption.qll @@ -59,7 +59,7 @@ predicate isInsecureEncryption(string name) { name.regexpMatch(getInsecureAlgori /** * Holds if there is additional evidence that `name` looks like it might be * related to operations with an encyption algorithm, besides the name of a - * specific algorithm. This can be used in conjuction with + * specific algorithm. This can be used in conjunction with * `isInsecureEncryption` to produce a stronger heuristic. */ bindingset[name] diff --git a/cpp/ql/src/Diagnostics/ExtractionProblems.qll b/cpp/ql/src/Diagnostics/ExtractionProblems.qll index c96e2e926e8..b6dd835261d 100644 --- a/cpp/ql/src/Diagnostics/ExtractionProblems.qll +++ b/cpp/ql/src/Diagnostics/ExtractionProblems.qll @@ -57,10 +57,10 @@ class ExtractionProblem extends TExtractionProblem { /** Gets the problem message for this problem. */ string getProblemMessage() { none() } - /** Gets the file this problem occured in. */ + /** Gets the file this problem occurred in. */ File getFile() { none() } - /** Gets the location this problem occured in. */ + /** Gets the location this problem occurred in. */ Location getLocation() { none() } /** Gets the SARIF severity of this problem. */ diff --git a/cpp/ql/src/Diagnostics/Internal/ExtractionErrors.qll b/cpp/ql/src/Diagnostics/Internal/ExtractionErrors.qll index 4cf6f8145f8..1ac69186a93 100644 --- a/cpp/ql/src/Diagnostics/Internal/ExtractionErrors.qll +++ b/cpp/ql/src/Diagnostics/Internal/ExtractionErrors.qll @@ -57,10 +57,10 @@ class ExtractionError extends TExtractionError { /** Gets the error message for this error. */ string getErrorMessage() { none() } - /** Gets the file this error occured in. */ + /** Gets the file this error occurred in. */ File getFile() { none() } - /** Gets the location this error occured in. */ + /** Gets the location this error occurred in. */ Location getLocation() { none() } /** Gets the SARIF severity of this error. */ diff --git a/cpp/ql/src/Security/CWE/CWE-611/XXE.ql b/cpp/ql/src/Security/CWE/CWE-611/XXE.ql index c8b638ddecd..80bd0fa6b7e 100644 --- a/cpp/ql/src/Security/CWE/CWE-611/XXE.ql +++ b/cpp/ql/src/Security/CWE/CWE-611/XXE.ql @@ -37,7 +37,7 @@ abstract class XXEFlowStateTranformer extends Expr { * Due to limitations of the implementation the transformation defined by this * predicate must be idempotent, that is, for any input `x` it must be that: * ``` - * transform(tranform(x)) = tranform(x) + * transform(transform(x)) = transform(x) * ``` */ abstract XXEFlowState transform(XXEFlowState flowstate); diff --git a/cpp/ql/test/TestUtilities/InlineExpectationsTest.qll b/cpp/ql/test/TestUtilities/InlineExpectationsTest.qll index a4d264b2703..3891fcf13a1 100644 --- a/cpp/ql/test/TestUtilities/InlineExpectationsTest.qll +++ b/cpp/ql/test/TestUtilities/InlineExpectationsTest.qll @@ -181,7 +181,7 @@ private string expectationCommentPattern() { result = "\\s*\\$((?:[^/]|/[^/])*)( /** * The possible columns in an expectation comment. The `TDefaultColumn` branch represents the first * column in a comment. This column is not precedeeded by a name. `TNamedColumn(name)` represents a - * column containing expected results preceeded by the string `name:`. + * column containing expected results preceded by the string `name:`. */ private newtype TColumn = TDefaultColumn() or