Skip to content

Commit

Permalink
Merge pull request #964 from ltratt/remove_outdated_comment
Browse files Browse the repository at this point in the history
`bb = usize::MAX` isn't a special value.
  • Loading branch information
vext01 authored Feb 8, 2024
2 parents d0c2883 + 78342e0 commit 7443540
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ykrt/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ pub enum TracedAOTBlock {
/// PERF: Use a string pool to avoid duplicated function names in traces.
func_name: CString,
/// The index of the block within the function.
///
/// The special value `usize::MAX` indicates unmappable code.
bb: usize,
},
/// One or more machine blocks that could not be mapped.
Expand All @@ -69,6 +67,10 @@ pub enum TracedAOTBlock {

impl TracedAOTBlock {
pub fn new_mapped(func_name: CString, bb: usize) -> Self {
// At one point, `bb = usize::MAX` was a special value, but it no longer is. We believe
// that no part of the code sets/checks for this value, but just in case there is a
// laggardly part of the code which does so, we've left this `assert` behind to catch it.
debug_assert_ne!(bb, usize::MAX);
Self::Mapped { func_name, bb }
}

Expand Down

0 comments on commit 7443540

Please sign in to comment.