From 860145884d0a7eea425d2ed90e73697f3fc333bc Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Fri, 7 Jun 2024 17:54:26 +0100 Subject: [PATCH] Ignore int3 instructions when counting instructions in tests These are generated as padding and are not actually part of the function. --- library/stdarch/crates/stdarch-test/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs index 5f1472d4c17e..a8c2d36e113d 100644 --- a/library/stdarch/crates/stdarch-test/src/lib.rs +++ b/library/stdarch/crates/stdarch-test/src/lib.rs @@ -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]; }