jlb6740 opened PR #14136 from jlb6740:fix-disassembler-silent-truncation to bytecodealliance:main:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
github-actions[bot] added the label cranelift on PR #14136.
github-actions[bot] added the label cranelift:area:machinst on PR #14136.
jlb6740 updated PR #14136.
jlb6740 edited PR #14136:
Capstone's
disasm_allstops at the first instruction it can't decode and
returns success with whatever it managed to decode. We never compared that
against the block length, so that instruction and everything after it
vanished from the listing. Forprecise-outputfiletests the truncated
output gets blessed, and the test then passes without asserting anything
about those bytes.This is reachable today: the bundled capstone can't decode AVX-VNNI, so a
function containingvpdpbusdwas silently dropping five instructions.Print the leftover bytes as
.byte, keeping the reloc and trap
annotations. s390x expectations already look like this. Resyncing after
the bad instruction isn't possible on x86 without knowing its length, and
guessing yields plausible but wrong instructions.The updated expectations only gain lines; nothing already printed changed.
Those blocks end in constant pool data that capstone was already rendering
as nonsense.
jlb6740 updated PR #14136.
jlb6740 edited PR #14136:
Capstone's
disasm_allstops at the first instruction it can't decode and
returns success with whatever it managed to decode. We never compared that
against the block length, so that instruction and everything after it
vanished from the listing. Forprecise-outputfiletests the truncated
output gets blessed, and the test then passes without asserting anything
about those bytes.This is reachable today: the bundled capstone can't decode AVX-VNNI, so a
function containingvpdpbusdwas silently dropping five instructions.
It is also a precursor to the APX work, whose EVEX map 4 encodings hit the
same path; those filetests were being blessed as truncated output and so
verified nothing about the instructions they were added to cover.Print the leftover bytes as
.byte, keeping the reloc and trap
annotations. s390x expectations already look like this. Resyncing after
the bad instruction isn't possible on x86 without knowing its length, and
guessing yields plausible but wrong instructions.The updated expectations only gain lines; nothing already printed changed.
Those blocks end in constant pool data that capstone was already rendering
as nonsense.
jlb6740 has marked PR #14136 as ready for review.
jlb6740 requested fitzgen for a review on PR #14136.
jlb6740 requested wasmtime-compiler-reviewers for a review on PR #14136.
jlb6740 updated PR #14136.
:thumbs_up: fitzgen submitted PR review.
fitzgen added PR #14136 Fix disassembler silent truncation to the merge queue.
:check: fitzgen merged PR #14136.
fitzgen removed PR #14136 Fix disassembler silent truncation from the merge queue.
Last updated: Aug 30 2026 at 09:07 UTC