Commit 9f1890d
fix(solidity): move basic-oracle-manipulation ruleid annotation to the matching line
The `pattern: $X.div($Y)` match for `underlyingUnit.mul(balanceWithInvested()).div(totalSupply())`
is textually on the line with the `:` (else) branch of the ternary, not the
line where the enclosing assignment starts. Confirmed by parsing this
snippet directly: the `.div(...)` call_expression's span is entirely on
that line. The `// ruleid:` annotation was one line above the wrong branch,
which happened to line up with a less precise (pre-tree-sitter-solidity
v1.2.13) parse of this multi-line ternary. Move the annotation immediately
above the branch actually being matched.
Surfaced by semgrep/ocaml-tree-sitter-semgrep#626 (tree-sitter-solidity
bump to v1.2.13), which produces the correct AST here.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 81634cf commit 9f1890d
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | 100 | | |
102 | 101 | | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments