Skip to content

[wasm-objdump] Fix missing error on bad opcode - #2696

Merged
sbc100 merged 1 commit into
mainfrom
bad_opcode_dump
Feb 25, 2026
Merged

sbc100 merged 1 commit into
mainfrom
bad_opcode_dump

Conversation

@sbc100

@sbc100 sbc100 commented Feb 24, 2026

Copy link
Copy Markdown
Member

In binary-reader-objdump were we suppressing all error except those in pre-pass, in order to avoid reporting them mulitple time.

However, the pre-pass is run with skip_function_bodies so opcode error are not shown in that pass.

@sbc100
sbc100 requested review from dschuff and keithw February 24, 2026 23:22
In binary-reader-objdump were we suppressing all error except those
in pre-pass, in order to avoid reporting them mulitple time.

However, the pre-pass is run with `skip_function_bodies` so opcode
error are not shown in that pass.
@sbc100
sbc100 enabled auto-merge (squash) February 25, 2026 00:09
Comment thread src/binary-reader.cc
}

Result BinaryReader::ReadFunctionBody(Offset end_offset) {
uint64_t total_locals = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is moving this code related to the error checking or just a cleanup?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with this code being moved we end up seeing any error that relate to locals being shown twice, once in the pre-pass and once in the disassembly.

Once we move this code into ReadFunctionBody it means that skip_function_bodies sill skip this too, which means that pre-pass will skip this, and the only disassembly will show local-related errors.

@sbc100
sbc100 disabled auto-merge February 25, 2026 19:04
@sbc100
sbc100 merged commit 82a8fb8 into main Feb 25, 2026
17 checks passed
@sbc100
sbc100 deleted the bad_opcode_dump branch February 25, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants