From 2b794d4fc67178ecc2ef62de8d6ba3bc690d34ac Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 30 Apr 2026 12:45:12 +0200 Subject: Don't do the 'accessed' check if "check:ignore" was given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- lib/xixanta/src/assembler.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/xixanta/src') diff --git a/lib/xixanta/src/assembler.rs b/lib/xixanta/src/assembler.rs index 47c662b..b01777c 100644 --- a/lib/xixanta/src/assembler.rs +++ b/lib/xixanta/src/assembler.rs @@ -1183,8 +1183,11 @@ impl<'a> Assembler<'a> { format!("{context_name}::{name}") }; - // Check if this variable/proc was ever accessed. - if !self.allow_unused && bundle.accessed == 0 { + // Check if this variable/proc was ever accessed. This check is + // performed unless the user explicitely told us not to do it + // (e.g. nasm's '--allow-unused' flag), or the magic + // 'asan:ignore' comment is given. + if !self.allow_unused && !bundle.asan_ignore && bundle.accessed == 0 { // If this was a .proc definition then we are certain that // this is dead code, which is a really crappy situation. if matches!(bundle.object_type, ObjectType::Proc) { -- cgit v1.2.3