wasm_interp: report todo! panics with file offset of the missing instruction

This commit is contained in:
Brian Carroll 2022-11-24 20:15:34 +00:00
parent f103801457
commit 9d437fe3fd
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
2 changed files with 162 additions and 459 deletions

View file

@ -1302,6 +1302,7 @@ impl<'a> Serialize for ElementSection<'a> {
#[derive(Debug)]
pub struct CodeSection<'a> {
pub function_count: u32,
pub section_offset: u32,
pub bytes: Vec<'a, u8>,
/// The start of each function
pub function_offsets: Vec<'a, u32>,
@ -1313,6 +1314,7 @@ impl<'a> CodeSection<'a> {
pub fn new(arena: &'a Bump) -> Self {
CodeSection {
function_count: 0,
section_offset: 0,
bytes: Vec::new_in(arena),
function_offsets: Vec::new_in(arena),
dead_import_dummy_count: 0,
@ -1360,6 +1362,7 @@ impl<'a> CodeSection<'a> {
Ok(CodeSection {
function_count,
section_offset: section_body_start as u32,
bytes,
function_offsets,
dead_import_dummy_count: 0,