From a4ca7a4f327a1f2af792fb15b60344bc8cc6487f Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 15:56:59 +0330 Subject: memdebug: accept 'memdebug scrub;' (the check compared against rt.scrub); the scrub program reads the freed word through asm --- tests/conformance/4-statements/memdebug_scrub_fills.zc | 4 ++-- tests/conformance/known.txt | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/conformance') 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 diff --git a/tests/conformance/known.txt b/tests/conformance/known.txt index 1adcdf4..0540721 100644 --- a/tests/conformance/known.txt +++ b/tests/conformance/known.txt @@ -1,7 +1,5 @@ # understood conformance failures: PATH IMPL CLASS reason # class a: self-hosted compiler bug; b: zc0 deviation (appendix a/b); c: spec issue to settle -4-statements/memdebug_scrub_accepted.zc zy a memdebug scrub; is rejected (appendix b.1.1, b.2.1) -4-statements/memdebug_scrub_fills.zc zy a memdebug scrub; is rejected (appendix b.1.1, b.2.1) 4-statements/o3_outside_function_ordinary_block.zc zy c top-level o3 { } is rejected; spec 4.10.2 says it is an ordinary block 4-statements/switch_tagged_match_by_tag.zc zy a case member(): on a member with fields is rejected (a case binds every field); spec 4.7.3 says it matches by tag 5-declarations/enum_member_names_earlier_b2.zc zy a appendix b.2.2 confirmed: enum members can't name earlier members -- cgit v1.2.3