Mercurial > projects > dstress
changeset 1023:740c7e3dae39
invalid code generation on linux with custom allocators/deallocators
<h3r3tic@mat.uni.torun.pl>
2006-05-23
news:bug-154-3@http.d.puremagic.com/bugzilla/
author | thomask |
---|---|
date | Wed, 24 May 2006 16:23:33 +0000 |
parents | db52d0fa9528 |
children | adf31c7a5127 |
files | run/d/delete_14_A.d run/d/delete_14_B.d |
diffstat | 2 files changed, 59 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/d/delete_14_A.d Wed May 24 16:23:33 2006 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-05-23 +// @uri@ news:bug-154-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.d.delete_14_A; + +class Foo{ + new (size_t s){ + return new byte[s]; + } + + delete(void* p){ + if (p){ + delete p; + } + } +} + +int main() { + Foo f = new Foo(); + delete f; + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/d/delete_14_B.d Wed May 24 16:23:33 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <h3r3tic@mat.uni.torun.pl> +// @date@ 2006-05-23 +// @uri@ news:bug-154-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.d.delete_14_B; + +class Foo{ + this(){ + } + + new (size_t s){ + return new byte[s]; + } + + delete(void* p){ + if (p){ + delete p; + } + } +} + +int main() { + Foo f = new Foo(); + delete f; + + return 0; +}