Spelling cpp#10825
Conversation
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
| * - `ConstantSignExpr`, for expressions with a compile-time constant value. | ||
| * - `FlowSignExpr`, for expressions whose sign can be computed from the signs of their operands. | ||
| * - `CustomsignExpr`, for expressions shose sign can be computed by a language-specific | ||
| * - `CustomsignExpr`, for expressions whose sign can be computed by a language-specific |
There was a problem hiding this comment.
Google Sheets didn't guess this correction...
| // not inside a template instantiation | ||
| not exists(Element other | this.isFromTemplateInstantiation(other)) or | ||
| // allow DeclarationEntrys of template specializations | ||
| // allow DeclarationEntries of template specializations |
There was a problem hiding this comment.
DeclarationEntry is probably a term. I left this change in to be able to hang this comment. I expect to drop this change.
There was a problem hiding this comment.
This probably should be something like
`DeclarationEntry`s
but I see already below that if we go down that route we should fix a bunch more formatting issues in this file, so this is probably better dealt with separately.
There was a problem hiding this comment.
I agree that
`DeclarationEntry`s
is preferable (rendered as DeclarationEntrys), the original is also OK.
| switch(c1){ | ||
| ... | ||
| dafault: // BAD: maybe it will be right `default` | ||
| default: // BAD: maybe it will be right `default` |
There was a problem hiding this comment.
This correction is probably wrong
There was a problem hiding this comment.
Yes, please revert. This shows we detect spelling mistakes in C/C++ code 😄
There was a problem hiding this comment.
personally, I encourage using things like default0, default_, or de_fault since they tend to be functionally equivalent in that they show that your tool catches spelling mistakes, while not actually upsetting spell checkers.
That said, I'm going to drop this and if there's interest, a change like that can be its own distinct PR.
There was a problem hiding this comment.
It depends on what the query actually checks for. I can have a look at that next week.
There was a problem hiding this comment.
I encourage using things like
default0,default_, orde_faultsince they tend to be functionally equivalent in that they show that your tool catches spelling mistakes
Unfortunately that's not going to work here, as the query looks for specific substitutions. This is the relevant query code:
(
lb.getName().charAt(0) = "d" or
lb.getName().charAt(0) = "c"
) and
(
lb.getName().charAt(1) = "e" or
lb.getName().charAt(1) = "a"
) and
(
lb.getName().charAt(2) = "f" or
lb.getName().charAt(2) = "s"
)Note that the query is marked as experimental, so the bar on query quality is very low here.
jketema
left a comment
There was a problem hiding this comment.
Few small comments but otherwise LGTM.
| // not inside a template instantiation | ||
| not exists(Element other | this.isFromTemplateInstantiation(other)) or | ||
| // allow DeclarationEntrys of template specializations | ||
| // allow DeclarationEntries of template specializations |
There was a problem hiding this comment.
This probably should be something like
`DeclarationEntry`s
but I see already below that if we go down that route we should fix a bunch more formatting issues in this file, so this is probably better dealt with separately.
| switch(c1){ | ||
| ... | ||
| dafault: // BAD: maybe it will be right `default` | ||
| default: // BAD: maybe it will be right `default` |
There was a problem hiding this comment.
Yes, please revert. This shows we detect spelling mistakes in C/C++ code 😄
geoffw0
left a comment
There was a problem hiding this comment.
I'm slightly horrified to see this amount of typos, missing characters and (incorrect) phonetic spellings that have accumulated in our code; and surely instyructions could only have been caused by a cosmic ray?
Thanks for fixing.
| * The `security` tag has been added to the `cpp/return-stack-allocated-memory` query. As a result, its results will now appear by default. | ||
| * The "Uncontrolled data in arithmetic expression" (cpp/uncontrolled-arithmetic) query has been enhanced to reduce false positive results and its @precision increased to high. | ||
| * A new `cpp/very-likely-overruning-write` query has been added to the default query suite for C/C++. The query reports some results that were formerly flagged by `cpp/overruning-write`. | ||
| * A new `cpp/very-likely-overrunning-write` query has been added to the default query suite for C/C++. The query reports some results that were formerly flagged by `cpp/overrunning-write`. |
There was a problem hiding this comment.
I'm not sure editing a past release not will affect anything, though I suppose there's no harm in trying.
There was a problem hiding this comment.
This was also done in the case of some of the other spelling PRs. I'm guessing this is fine, these changes just not get included in the previous releases.
| not ae instanceof ForStmtSideEffectExpr | ||
| select ae, | ||
| "AV Rule 160: An assignment expression shall be used only as the exprression in an expression statement." | ||
| "AV Rule 160: An assignment expression shall be used only as the expression in an expression statement." |
There was a problem hiding this comment.
I'm a bit disappointed there are apparently no test cases for these two old queries (but I'm happy with the spelling fixes on them).
|
|
||
| /** Holds if there are labels inside the block with names similar to `default` or `case`. */ | ||
| predicate isWrongLableName(SwitchStmt swtmp) { | ||
| predicate isWrongLabelName(SwitchStmt swtmp) { |
Check warning
Code scanning / CodeQL
Missing QLDoc for parameter
|
Ok, this PR and #10824 conceptually conflict in that they both will trigger a complaint akin to: Run python config/sync-files.py
Loading file groups from ./config/identical-files.json
ERROR: config/sync-files.py:0 - Files from group 'IR Instruction' not in sync.
ERROR: config/sync-files.py:0 - Run this script with a file-name argument among the following to overwrite the remaining files with the contents of that file, or run with the --latest switch to update each group of files from the most recently modified file in the group.
ERROR: config/sync-files.py:0 - ./cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll
ERROR: config/sync-files.py:0 - ./cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll
ERROR: config/sync-files.py:0 - ./cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll
ERROR: config/sync-files.py:0 - ./csharp/ql/src/experimental/ir/implementation/raw/Instruction.qll
ERROR: config/sync-files.py:0 - ./csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Instruction.qll
ERROR: config/sync-files.py:0 - Files from group 'IR SSA SSAConstruction' not in sync.
ERROR: config/sync-files.py:0 - Run this script with a file-name argument among the following to overwrite the remaining files with the contents of that file, or run with the --latest switch to update each group of files from the most recently modified file in the group.
ERROR: config/sync-files.py:0 - ./cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll
ERROR: config/sync-files.py:0 - ./cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/internal/SSAConstruction.qll
ERROR: config/sync-files.py:0 - ./csharp/ql/src/experimental/ir/implementation/unaliased_ssa/internal/SSAConstruction.qll
Error: Process completed with exit code 1.for a in cpp csharp; do echo $a; git log --oneline --graph main..spelling-$a -- ./cpp/ql/lib/semmle/code/cpp/ir/implementation ./csharp/ql/src/experimental/ir/implementation ; done
cpp
* 991067cb20 spelling: instructions
* ab88b3f56d spelling: hypothetical
* e2f8d7e1ab spelling: exploit
* b244d01a37 spelling: dynamic
* 87d1a8b02a spelling: different
* ad192497ba spelling: circuit
* d3802b378e spelling: aliased
csharp
* 3afbdf7f1b spelling: opposed
* b61e02cc17 spelling: known
* a3f1affff7 spelling: instructions
* 0e09910601 spelling: hypothetical
* 9383e1f549 spelling: dynamic
* bf7011612c spelling: differentI'll need to pull some changes into one of these two and drop them from the other (or kick them into a third). I've done each and have no particular preference. |
jsoref
left a comment
There was a problem hiding this comment.
I've synced over the cpp/csharp shared unit bits using something equivalent to this:
while [ -e .git/rebase-merge/git-rebase-todo ] ; do
python3 config/sync-files.py --latest
git add -u
GIT_EDITOR=true git rebase --continue
done| * containing the `ExitFunction` instruction for that function. | ||
| * | ||
| * There are two differet return instructions: `ReturnValueInstruction`, for returning a value from | ||
| * There are two different return instructions: `ReturnValueInstruction`, for returning a value from |
There was a problem hiding this comment.
| * If the operand holds a null address, the result is a null address. | ||
| * | ||
| * This instruction is used to represent `dyanmic_cast<void*>` in C++, which returns the pointer to | ||
| * This instruction is used to represent `dynamic_cast<void*>` in C++, which returns the pointer to |
There was a problem hiding this comment.
| * If the operand holds a null address, the result is a null address. | ||
| * | ||
| * This instruction is used to represent `dyanmic_cast<void*>` in C++, which returns the pointer to | ||
| * This instruction is used to represent `dynamic_cast<void*>` in C++, which returns the pointer to |
There was a problem hiding this comment.
| instr = reusedPhiInstruction(_) and | ||
| // Check that the phi instruction is *not* degenerate, but we can't use | ||
| // getDegeneratePhiOperand in the first stage with phi instyructions | ||
| // getDegeneratePhiOperand in the first stage with phi instructions |
There was a problem hiding this comment.
|
|
||
| /** | ||
| * Gets the rank index of a hyphothetical use one instruction past the end of | ||
| * Gets the rank index of a hypothetical use one instruction past the end of |
There was a problem hiding this comment.
|
Yeah, so all changes related to "IR" (see directory name), are indeed best dealt with on the C++ side, moving the related C# changes to this PR is the correct thing to do. |
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
|
@jsoref Thanks for these fixes |
follow-up to #10743