<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools.nes/tests/expected/asan_reserve_constant.txt, branch main</title>
<subtitle>Tools for NES/Famicom development.
</subtitle>
<id>https://git.mssola.com/nes/tools.nes/atom?h=main</id>
<link rel='self' href='https://git.mssola.com/nes/tools.nes/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/'/>
<updated>2025-12-15T21:15:09Z</updated>
<entry>
<title>Allow constants in asan:reserve statements</title>
<updated>2025-12-15T21:15:09Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2025-12-15T21:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=ec935330d4518829d01bbdf5670c4569fa07a567'/>
<id>urn:sha1:ec935330d4518829d01bbdf5670c4569fa07a567</id>
<content type='text'>
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à &lt;mssola@mssola.com&gt;
</content>
</entry>
</feed>
