diff options
| author | 2026-10-14 15:56:59 +0330 | |
|---|---|---|
| committer | 2026-10-14 15:56:59 +0330 | |
| commit | a4ca7a4f327a1f2af792fb15b60344bc8cc6487f (patch) | |
| tree | 65928803c9acee850c0f2dcef85fbcf31d37cfca /tests/conformance/4-statements | |
| parent | return: a value returned from a void function is dropped and the function yie... (diff) | |
memdebug: accept 'memdebug scrub;' (the check compared against rt.scrub); the scrub program reads the freed word through asm
Diffstat (limited to 'tests/conformance/4-statements')
| -rw-r--r-- | tests/conformance/4-statements/memdebug_scrub_fills.zc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/conformance/4-statements/memdebug_scrub_fills.zc b/tests/conformance/4-statements/memdebug_scrub_fills.zc index ad15e3d..eed4c2d 100644 --- a/tests/conformance/4-statements/memdebug_scrub_fills.zc +++ b/tests/conformance/4-statements/memdebug_scrub_fills.zc @@ -1,10 +1,10 @@ // expect: 57005/ -// spec 4.11: memdebug scrub; fills freed payloads with 57005 +// spec 4.11: memdebug scrub; fills freed payloads with 57005 (read through asm, which the use-after-free check does not see) include rt; void pn(int x) { rt.put_n(x); rt.put_c(10); } memdebug scrub; fn main() { - unchecked { int* p = rt.new(int); *p = 5; rt.free(p); pn(*p); } + unchecked { int* p = rt.new(int); *p = 5; word a = p; rt.free(p); pn(asm { a @ @ }); } return 0; } // zc0: skip |
