mirror of
https://github.com/github/codeql.git
synced 2026-04-23 15:55:18 +02:00
Extractor: fix child index values
This commit is contained in:
@@ -232,8 +232,8 @@ impl Visitor<'_> {
|
||||
)
|
||||
}
|
||||
}
|
||||
Storage::Table { index } => {
|
||||
for child_id in child_ids {
|
||||
Storage::Table => {
|
||||
for (index, child_id) in child_ids.iter().enumerate() {
|
||||
self.trap_output.push(TrapEntry::ChildOf(
|
||||
node_type_name(&field.parent.kind, field.parent.named),
|
||||
parent_id,
|
||||
@@ -241,7 +241,7 @@ impl Visitor<'_> {
|
||||
Some(name) => name.to_owned(),
|
||||
None => "child".to_owned(),
|
||||
},
|
||||
Index(*index),
|
||||
Index(index),
|
||||
*child_id,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -38,9 +38,7 @@ pub enum Storage {
|
||||
/// the field is stored as a column in the parent table
|
||||
Column,
|
||||
// the field is store in a link table
|
||||
Table {
|
||||
index: usize,
|
||||
},
|
||||
Table,
|
||||
}
|
||||
|
||||
pub fn read_node_types(node_types_path: &Path) -> std::io::Result<Vec<Entry>> {
|
||||
@@ -123,9 +121,7 @@ fn add_field(
|
||||
} else {
|
||||
// This field can appear zero or multiple times, so put
|
||||
// it in an auxiliary table.
|
||||
storage = Storage::Table {
|
||||
index: fields.len(),
|
||||
};
|
||||
storage = Storage::Table;
|
||||
}
|
||||
fields.push(Field {
|
||||
parent: TypeName {
|
||||
|
||||
Reference in New Issue
Block a user