From d6e8acd080b2ec0252d0014385c11c52448a095b Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Tue, 11 Feb 2025 12:44:19 +0100 Subject: [PATCH] C#/Ruby/Swift: Tweaks to documentation Co-authored-by: Anders Schack-Mulligen --- .../ql/lib/semmle/code/csharp/controlflow/BasicBlocks.qll | 4 ++-- shared/controlflow/codeql/controlflow/BasicBlock.qll | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/controlflow/BasicBlocks.qll b/csharp/ql/lib/semmle/code/csharp/controlflow/BasicBlocks.qll index d37af2f57e50..9e548838adec 100644 --- a/csharp/ql/lib/semmle/code/csharp/controlflow/BasicBlocks.qll +++ b/csharp/ql/lib/semmle/code/csharp/controlflow/BasicBlocks.qll @@ -211,8 +211,8 @@ final class BasicBlock extends BasicBlocksImpl::BasicBlock { * * Edge dominance is similar to node dominance except it concerns edges * instead of nodes: A basic block is dominated by a _basic block_ `bb` if it - * can only be reached through `bb` and dominated by an _edge_ `s` if it can - * only be reached through `s`. + * can only be reached through `bb` and dominated by an _edge_ `e` if it can + * only be reached through `e`. * * Note that where all basic blocks (except the entry basic block) are * strictly dominated by at least one basic block, a basic block may not be diff --git a/shared/controlflow/codeql/controlflow/BasicBlock.qll b/shared/controlflow/codeql/controlflow/BasicBlock.qll index 1deb7cb42925..fb929539685a 100644 --- a/shared/controlflow/codeql/controlflow/BasicBlock.qll +++ b/shared/controlflow/codeql/controlflow/BasicBlock.qll @@ -264,17 +264,17 @@ module Make Input> { predicate dominatingEdge(BasicBlock bb1, BasicBlock bb2) { bb1.getASuccessor(_) = bb2 and bbIDominates(bb1, bb2) and - // The above is not sufficient to ensure that `bb1` can only be reached + // The above is not sufficient to ensure that `bb2` can only be reached // through `(bb1, bb2)`. To see why, consider this example corresponding to - // an `if` statement without an `else` block and whe `A` is the basic block + // an `if` statement without an `else` block where `A` is the basic block // following the `if` statement: // ``` // ... --> cond --[true]--> ... --> A - // \ / + // \ ^ // ----[false]----------- // ``` // Here `A` is a direct successor of `cond` along the `false` edge and it - // is immediately dominated by `cond`, but `A` is not controlled by the + // is immediately dominated by `cond`, but `A` is not dominated by the // `false` edge since it is also possible to reach `A` via the `true` // edge. //