Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce2fdb3

Browse files
committed
Address comments
1 parent 679d81a commit ce2fdb3

31 files changed

Lines changed: 405 additions & 324 deletions

rust/.generated.list

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

rust/.gitattributes

Lines changed: 11 additions & 9 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: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ pub struct If {
478478
pub id: TrapId,
479479
pub location: Option<trap::Label>,
480480
pub condition: trap::Label,
481-
pub then_branch: trap::Label,
482-
pub else_branch: Option<trap::Label>,
481+
pub then: trap::Label,
482+
pub else_: Option<trap::Label>,
483483
}
484484

485485
impl TrapEntry for If {
@@ -488,12 +488,12 @@ impl TrapEntry for If {
488488
}
489489

490490
fn emit(self, id: trap::Label, out: &mut trap::Writer) {
491-
out.add_tuple("ifs", vec![trap::Arg::Label(id), self.condition.into(), self.then_branch.into()]);
491+
out.add_tuple("ifs", vec![trap::Arg::Label(id), self.condition.into(), self.then.into()]);
492492
if let Some(v) = self.location {
493493
out.add_tuple("locatable_locations", vec![trap::Arg::Label(id), v.into()]);
494494
}
495-
if let Some(v) = self.else_branch {
496-
out.add_tuple("if_else_branches", vec![trap::Arg::Label(id), v.into()]);
495+
if let Some(v) = self.else_ {
496+
out.add_tuple("if_elses", vec![trap::Arg::Label(id), v.into()]);
497497
}
498498
}
499499
}
@@ -1135,20 +1135,20 @@ impl TrapEntry for TupleStructPat {
11351135
}
11361136

11371137
#[derive(Debug)]
1138-
pub struct UnaryExpr {
1138+
pub struct UnaryOp {
11391139
pub id: TrapId,
11401140
pub location: Option<trap::Label>,
11411141
pub expr: trap::Label,
11421142
pub op: String,
11431143
}
11441144

1145-
impl TrapEntry for UnaryExpr {
1145+
impl TrapEntry for UnaryOp {
11461146
fn extract_id(&mut self) -> TrapId {
11471147
std::mem::replace(&mut self.id, TrapId::Star)
11481148
}
11491149

11501150
fn emit(self, id: trap::Label, out: &mut trap::Writer) {
1151-
out.add_tuple("unary_exprs", vec![trap::Arg::Label(id), self.expr.into(), self.op.into()]);
1151+
out.add_tuple("unary_ops", vec![trap::Arg::Label(id), self.expr.into(), self.op.into()]);
11521152
if let Some(v) = self.location {
11531153
out.add_tuple("locatable_locations", vec![trap::Arg::Label(id), v.into()]);
11541154
}
@@ -1240,21 +1240,21 @@ impl TrapEntry for Yield {
12401240
}
12411241

12421242
#[derive(Debug)]
1243-
pub struct Async {
1243+
pub struct AsyncBlock {
12441244
pub id: TrapId,
12451245
pub location: Option<trap::Label>,
12461246
pub statements: Vec<trap::Label>,
12471247
pub tail: Option<trap::Label>,
12481248
pub label: Option<String>,
12491249
}
12501250

1251-
impl TrapEntry for Async {
1251+
impl TrapEntry for AsyncBlock {
12521252
fn extract_id(&mut self) -> TrapId {
12531253
std::mem::replace(&mut self.id, TrapId::Star)
12541254
}
12551255

12561256
fn emit(self, id: trap::Label, out: &mut trap::Writer) {
1257-
out.add_tuple("asyncs", vec![trap::Arg::Label(id)]);
1257+
out.add_tuple("async_blocks", vec![trap::Arg::Label(id)]);
12581258
if let Some(v) = self.location {
12591259
out.add_tuple("locatable_locations", vec![trap::Arg::Label(id), v.into()]);
12601260
}
@@ -1271,21 +1271,21 @@ impl TrapEntry for Async {
12711271
}
12721272

12731273
#[derive(Debug)]
1274-
pub struct Unsafe {
1274+
pub struct UnsafeBlock {
12751275
pub id: TrapId,
12761276
pub location: Option<trap::Label>,
12771277
pub statements: Vec<trap::Label>,
12781278
pub tail: Option<trap::Label>,
12791279
pub label: Option<String>,
12801280
}
12811281

1282-
impl TrapEntry for Unsafe {
1282+
impl TrapEntry for UnsafeBlock {
12831283
fn extract_id(&mut self) -> TrapId {
12841284
std::mem::replace(&mut self.id, TrapId::Star)
12851285
}
12861286

12871287
fn emit(self, id: trap::Label, out: &mut trap::Writer) {
1288-
out.add_tuple("unsaves", vec![trap::Arg::Label(id)]);
1288+
out.add_tuple("unsafe_blocks", vec![trap::Arg::Label(id)]);
12891289
if let Some(v) = self.location {
12901290
out.add_tuple("locatable_locations", vec![trap::Arg::Label(id), v.into()]);
12911291
}

rust/ql/lib/codeql/rust/elements.qll

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

rust/ql/lib/codeql/rust/elements/Async.qll renamed to rust/ql/lib/codeql/rust/elements/AstNode.qll

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/ql/lib/codeql/rust/elements/UnaryExpr.qll renamed to rust/ql/lib/codeql/rust/elements/AsyncBlock.qll

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/ql/lib/codeql/rust/elements/AsyncConstructor.qll renamed to rust/ql/lib/codeql/rust/elements/AsyncBlockConstructor.qll

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/ql/lib/codeql/rust/elements/Unsafe.qll renamed to rust/ql/lib/codeql/rust/elements/UnaryOp.qll

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/ql/lib/codeql/rust/elements/UnsafeConstructor.qll renamed to rust/ql/lib/codeql/rust/elements/UnaryOpConstructor.qll

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/ql/lib/codeql/rust/elements/UnsafeBlock.qll

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

0 commit comments

Comments
 (0)