Skip to content

Commit

Permalink
Ignore int3 instructions when counting instructions in tests
Browse files Browse the repository at this point in the history
These are generated as padding and are not actually part of the
function.
  • Loading branch information
Amanieu committed Jun 7, 2024
1 parent df3618d commit 443063a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/stdarch-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) {
//eprintln!(" function: {:?}", function);

let mut instrs = &function.instrs[..];
while instrs.last().map_or(false, |s| s == "nop") {
while instrs.last().map_or(false, |s| s == "nop" || s == "int3") {
instrs = &instrs[..instrs.len() - 1];
}

Expand Down

0 comments on commit 443063a

Please sign in to comment.