Skip to content

Commit

Permalink
Merge branch 'aibaars/rust-format-templates' into aibaars/local-defs
Browse files Browse the repository at this point in the history
  • Loading branch information
aibaars committed Oct 18, 2024
2 parents 4a5a48a + 08b4b79 commit e93ebf5
Show file tree
Hide file tree
Showing 32 changed files with 1,042 additions and 33 deletions.
17 changes: 11 additions & 6 deletions rust/ql/.generated.list

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion rust/ql/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,26 @@ class FormatArgsExprTree extends StandardPostOrderTree, FormatArgsExpr {
i = -1 and result = this.getTemplate()
or
result = this.getArg(i).getExpr()
or
result =
any(ImplicitVariableAccess v, Format f, int index, int kind |
f = this.getFormat(index) and
(
v.getArgument() = f.getArgumentRef() and kind = 0
or
v.getArgument() = f.getWidthArgument() and kind = 1
or
v.getArgument() = f.getPrecisionArgument() and kind = 2
) and
i = this.getNumberOfArgs() + index * 3 + kind
|
v
)
}
}

class ImplictVariableAccessTree extends LeafTree, ImplicitVariableAccess { }

class IndexExprTree extends StandardPostOrderTree instanceof IndexExpr {
override AstNode getChildNode(int i) {
i = 0 and result = super.getBase()
Expand Down
3 changes: 3 additions & 0 deletions rust/ql/lib/codeql/rust/elements.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions rust/ql/lib/codeql/rust/elements/Format.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions rust/ql/lib/codeql/rust/elements/FormatArgument.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e93ebf5

Please sign in to comment.