`@ensure` doesn't work with macros
<*
@ensure @volatile_load(*&&false)
*>
macro void foo() {}
fn int main()
{
foo();
return 0;
}
expected behavior: the program crashes with the message ERROR: '@ensure "@volatile_load(*&&false)" violated.' like it does when it's a function
actual behavior: the program runs without error.
when it's @require instead of @ensure it gives a correct error
C3 Compiler Version: 0.7.2 (Pre-release, Jan 1 1980 00:00:00)
Installed directory: /nix/store/zqa3bqdpcv478x7q4s58sv50rk3r4x56-c3c-0.7.2/bin/
Git Hash: b83e57b952da736cfd46e361b3deed26fbe895b8
Backends: LLVM
LLVM version: 19.1.6
LLVM default target: x86_64-unknown-linux-gnu
Yes, and I see that fn works correctly as well.
I forgot about this. This works properly for CONSTANT checks, but not runtime checks, and this was because the macros were the first ones to get checking and at the time my focus was on static checks.
This is kind of a lot, so I need some time for it.
Let's do this next cycle.