Skip to content

Commit 7b44457

Browse files
committed
refactor(tracker): move branch-selection bit skip from jet handler to assertion handler
1 parent 509fa0b commit 7b44457

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

src/tracker.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ impl<'a> DefaultTracker<'a> {
185185

186186
let mut input_frame = input.clone();
187187

188-
// The reason we need to advance by a bit is that the AssertL combinator is actually a Case combinator,
189-
// which takes a bit of input to decide which branch to take. But this bit is "meaningless" and
190-
// is always 0 because it's an assertion.
191-
let _ = input_frame.next();
192-
193188
let args = match parse_jet_arguments(jet, &mut input_frame) {
194189
Ok(args) => args,
195190
Err(e) => {
@@ -219,13 +214,6 @@ impl<'a> DefaultTracker<'a> {
219214
let target_ty = &node.arrow().target;
220215
let jet_target_ty = resolve_jet_type(&target_type(jet));
221216

222-
// Skip the leading bit when the frame has extra padding.
223-
// This occurs because some jets (like eq_64 etc.) are wrapped in AssertL (a Case combinator),
224-
// see compile::with_debug_symbol
225-
if target_ty.as_sum().is_some() {
226-
let _ = output_frame.next();
227-
}
228-
229217
let output_value = SimValue::from_padded_bits(&mut output_frame, target_ty)
230218
.expect("output from bit machine is always well-formed");
231219

@@ -259,7 +247,10 @@ impl<'a> DefaultTracker<'a> {
259247

260248
let mut input_frame = input.clone();
261249

262-
// Skip the Case combinator's branch selection bit (see handle_jet).
250+
// Skip the Case combinator's branch selection bit
251+
// The reason we need to advance by a bit is that the AssertL combinator is actually a Case combinator,
252+
// which takes a bit of input to decide which branch to take. But this bit is "meaningless" and
253+
// is always 0 because it's an assertion.
263254
let _ = input_frame.next();
264255

265256
// The debug call has signature `dbg!(T) -> T`, so the target type

0 commit comments

Comments
 (0)