Skip to content

Commit

Permalink
Merge pull request #37 from PROMETHIA-27/disassembly-error-message
Browse files Browse the repository at this point in the history
  • Loading branch information
playXE authored Oct 26, 2023
2 parents 22ab250 + 29b78f6 commit 02e1c7f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/jit/compilation.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::sync::Arc;

use macroassembler::{
assembler::disassembler::try_to_disassemble, wtf::executable_memory_handle::CodeRef,
};
use macroassembler::wtf::executable_memory_handle::CodeRef;

use crate::data_section::DataSection;

Expand Down Expand Up @@ -44,8 +42,9 @@ impl Compilation {
// SAFETY:
// `code_ref` is fully initialized
//
#[cfg(feature = "disassembly")]
unsafe {
try_to_disassemble(
macroassembler::assembler::disassembler::try_to_disassemble(
self.code_ref.start(),
self.code_ref.size_in_bytes(),
" ",
Expand All @@ -54,6 +53,11 @@ impl Compilation {
.unwrap();
}

#[cfg(not(feature = "disassembly"))]
{
out.push_str("please enable the disassembly feature to show code disassembly");
}

out
}
}

0 comments on commit 02e1c7f

Please sign in to comment.