Skip to content

Commit

Permalink
detect External indices more generally in internalize_constant (#2395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthom committed Apr 29, 2024
1 parent 9837187 commit bcfa021
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions build/instructions_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,13 @@ fn generate_instruction_preface() -> TokenStream {
},
}
}

pub fn is_external(&self) -> bool {
matches!(
self,
IndexingCodePtr::External(_) | IndexingCodePtr::DynamicExternal(_)
)
}
}

impl IndexingInstruction {
Expand Down
12 changes: 6 additions & 6 deletions src/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ impl<'a> IndexingCodeMergingPtr<'a> {
Some(OptArgIndexKey::Literal(_, _, constant, _)) => {
constants.insert(*constant, constant_ptr);
}
_ if constant_ptr.is_external() => {
// this must be a defunct clause, because it's been deleted
// from the skeleton.
debug_assert!(constant_key.is_none());
}
_ => {
if let IndexingCodePtr::DynamicExternal(_) = constant_ptr {
// this must be a defunct clause, because it's been deleted
// from the skeleton.
} else {
unreachable!()
}
unreachable!()
}
}

Expand Down

0 comments on commit bcfa021

Please sign in to comment.