Skip to content

Commit

Permalink
Update macro if __internal_flip feature is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsck committed Oct 7, 2021
1 parent f1140c0 commit 83379c9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/rust/iced-x86/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ macro_rules! read_u32_break {
mk_read_xx! {$slf, u32, u32::from_le, usize, break}
}};
}
#[cfg(not(feature = "__internal_flip"))]
macro_rules! read_op_mem_stmt_ret {
($decoder:ident, $instruction:ident, $stmts:block) => {{
debug_assert!($decoder.state.encoding() != EncodingKind::EVEX as u32 && $decoder.state.encoding() != EncodingKind::MVEX as u32);
Expand All @@ -67,11 +68,24 @@ macro_rules! read_op_mem_stmt_ret {
}
}};
}
#[cfg(not(feature = "__internal_flip"))]
macro_rules! read_op_mem_stmt {
($decoder:ident, $instruction:ident, $stmts:block) => {
let _ = read_op_mem_stmt_ret!($decoder, $instruction, $stmts);
};
}
#[cfg(feature = "__internal_flip")]
macro_rules! read_op_mem_stmt {
($decoder:ident, $instruction:ident, $stmts:block) => {
debug_assert!($decoder.state.encoding() != EncodingKind::EVEX as u32 && $decoder.state.encoding() != EncodingKind::MVEX as u32);
$stmts
if $decoder.state.address_size != OpSize::Size16 {
let _ = $decoder.read_op_mem_32_or_64($instruction);
} else {
$decoder.read_op_mem_16($instruction, TupleType::N1);
}
};
}

mod enums;
mod handlers;
Expand Down

0 comments on commit 83379c9

Please sign in to comment.