Use this assembler to emit machine code into a byte buffer. This will skip any traps or label registrations, but this is fine for the single-instruction disassembly we're doing here.
(inst: &Inst<FuzzRegs>)
| 47 | /// This will skip any traps or label registrations, but this is fine for the |
| 48 | /// single-instruction disassembly we're doing here. |
| 49 | fn assemble(inst: &Inst<FuzzRegs>) -> Vec<u8> { |
| 50 | let mut sink = TestCodeSink::default(); |
| 51 | inst.encode(&mut sink); |
| 52 | sink.patch_labels_as_if_they_referred_to_end(); |
| 53 | sink.buf |
| 54 | } |
| 55 | |
| 56 | #[derive(Default)] |
| 57 | struct TestCodeSink { |
no test coverage detected