aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 15:56:59 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 15:56:59 +0330
commita4ca7a4f327a1f2af792fb15b60344bc8cc6487f (patch)
tree65928803c9acee850c0f2dcef85fbcf31d37cfca /tests
parentreturn: 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')
-rw-r--r--tests/conformance/4-statements/memdebug_scrub_fills.zc4
-rw-r--r--tests/conformance/known.txt2
2 files changed, 2 insertions, 4 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
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