diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2025-12-15 22:15:09 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2025-12-15 22:15:09 +0100 |
| commit | ec935330d4518829d01bbdf5670c4569fa07a567 (patch) | |
| tree | 2ee487e1796d461b296e61791b7fdff43b14529d /lib/xixanta/src/node.rs | |
| parent | b7645c842f6c3fd718debe8de3e32ae346b17567 (diff) | |
| download | tools.nes-ec935330d4518829d01bbdf5670c4569fa07a567.tar.gz tools.nes-ec935330d4518829d01bbdf5670c4569fa07a567.zip | |
Allow constants in asan:reserve statements
This way, if you define a constant like:
MY_BUFFER_LEN_IN_BYTES = $10
You can then declare your buffer like so:
zp_buffer = $00 ; asan:reserve MY_BUFFER_LEN_IN_BYTES
And then further in the code you can rely on just using the constant for
bound checking, and then the address sanitizer will check on bound
checks via static analysis as well.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'lib/xixanta/src/node.rs')
| -rw-r--r-- | lib/xixanta/src/node.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/xixanta/src/node.rs b/lib/xixanta/src/node.rs index 65bc09e..3f1778a 100644 --- a/lib/xixanta/src/node.rs +++ b/lib/xixanta/src/node.rs @@ -259,6 +259,7 @@ pub enum OperationType { #[derive(Debug, Clone, PartialEq)] pub enum CommentType { + AsanReserveIdentifier(PString), AsanReserve(usize), AsanIgnore, } @@ -356,6 +357,7 @@ impl fmt::Display for NodeType { OperationType::Greater => write!(f, "greater"), }, NodeType::Comment(ct) => match ct { + CommentType::AsanReserveIdentifier(_) => write!(f, ";; asan:reserve"), CommentType::AsanReserve(_) => write!(f, ";; asan:reserve"), CommentType::AsanIgnore => write!(f, ";; asan:ignore"), }, |
