MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / stack_base_at_frame

Method stack_base_at_frame

crates/parser/src/visit.rs:560–578  ·  view source on GitHub ↗
(&self, depth: usize)

Source from the content-addressed store, hash-verified

558 }
559
560 fn stack_base_at_frame(&self, depth: usize) -> StackBase {
561 let Some(frame) = self.validator.get_control_frame(depth) else {
562 return StackBase::default();
563 };
564 let mut base = StackBase::default();
565 let stack_height = self.validator.operand_stack_height() as usize;
566 for i in 0..frame.height {
567 let depth_from_top = stack_height - 1 - i;
568 if let Some(Some(ty)) = self.validator.get_operand_type(depth_from_top) {
569 match operand_size(ty) {
570 OperandSize::S32 => base.s32 += 1,
571 OperandSize::S64 => base.s64 += 1,
572 OperandSize::S128 => base.s128 += 1,
573 }
574 }
575 }
576
577 base
578 }
579
580 fn unsupported(&mut self, name: &str) {
581 self.record_error(crate::ParseError::UnsupportedOperator(name.to_string()));

Callers 2

emit_br_table_padMethod · 0.80

Calls 1

operand_sizeFunction · 0.85

Tested by

no test coverage detected