Skip to content

Commit 1a9b232

Browse files
committed
Add SlicePat::{slice, suffix}
1 parent 406d03e commit 1a9b232

File tree

6 files changed

+67
-3
lines changed

6 files changed

+67
-3
lines changed

rust/.generated.list

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/generated/top.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,8 @@ pub struct SlicePat {
10521052
pub id: TrapId,
10531053
pub location: Option<trap::Label>,
10541054
pub prefix: Vec<trap::Label>,
1055+
pub slice: Option<trap::Label>,
1056+
pub suffix: Vec<trap::Label>,
10551057
}
10561058

10571059
impl TrapEntry for SlicePat {
@@ -1067,6 +1069,12 @@ impl TrapEntry for SlicePat {
10671069
for (i, &v) in self.prefix.iter().enumerate() {
10681070
out.add_tuple("slice_pat_prefixes", vec![trap::Arg::Label(id), i.into(), v.into()]);
10691071
}
1072+
if let Some(v) = self.slice {
1073+
out.add_tuple("slice_pat_slice", vec![trap::Arg::Label(id), v.into()]);
1074+
}
1075+
for (i, &v) in self.suffix.iter().enumerate() {
1076+
out.add_tuple("slice_pat_suffixes", vec![trap::Arg::Label(id), i.into(), v.into()]);
1077+
}
10701078
}
10711079
}
10721080

rust/ql/lib/codeql/rust/generated/Raw.qll

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/generated/SlicePat.qll

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/rust.dbscheme

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,19 @@ slice_pat_prefixes(
578578
int prefix: @pat ref
579579
);
580580

581+
#keyset[id]
582+
slice_pat_slice(
583+
int id: @slice_pat ref,
584+
int slice: @pat ref
585+
);
586+
587+
#keyset[id, index]
588+
slice_pat_suffixes(
589+
int id: @slice_pat ref,
590+
int index: int ref,
591+
int suffix: @pat ref
592+
);
593+
581594
tuples(
582595
unique int id: @tuple
583596
);

rust/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ class RangePat(Pat):
531531

532532
class SlicePat(Pat):
533533
prefix: list[Pat]
534+
slice: optional[Pat]
535+
suffix: list[Pat]
534536
# Path(Box<Path>),
535537

536538

0 commit comments

Comments
 (0)