Mercurial > projects > dstress
changeset 1449:6666662e4363
[Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare
Madeleine Freudenberg <madou@madou.org>
2007-04-01
http://d.puremagic.com/issues/show_bug.cgi?id=1089
author | thomask |
---|---|
date | Wed, 04 Apr 2007 20:29:33 +0000 |
parents | b0b70172c68b |
children | 2322c29c00be |
files | reporter.txt run/t/typeinfo_03_A.d run/t/typeinfo_03_B.d run/t/typeinfo_03_C.d run/t/typeinfo_03_D.d |
diffstat | 5 files changed, 120 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/reporter.txt Wed Apr 04 20:29:08 2007 +0000 +++ b/reporter.txt Wed Apr 04 20:29:33 2007 +0000 @@ -101,6 +101,7 @@ Lionello Lunesu <lionello.lunesu@crystalinter.remove.com>, <lio@lunesu.com> Luís Marques <luismarques@gmail.com> Lukas Pinkowski <Lukas.Pinkowski@web.de> +Madeleine Freudenberg <madou@madou.org> Manfred Nowak <svv1999@hotmail.com> Manuel König <manuelk89@gmx.net> marko <tm030127d@galeb.etf.bg.ac.yu> @@ -166,6 +167,7 @@ Vathix <chris@dprogramming.com>, <vathix@dprogramming.com>, <vathixSpamFix@dprogramming.com> Victor Nakoryakov <nail-mail@mail.ru> Vladimir <v04bvs@gmail.com> +Vladimir <thecybershadow@gmail.com> Walter <newshound@digitalmars.com> Witold Baryluk <aryluk@mpi.int.pl> xs0 <xs0@xs0.com>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typeinfo_03_A.d Wed Apr 04 20:29:33 2007 +0000 @@ -0,0 +1,30 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Madeleine Freudenberg <madou@madou.org> +// @date@ 2007-04-01 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089 +// @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare + +module dstress.run.t.typeinfo_03_A; + +int main(){ + TypeInfo_Pointer t = new TypeInfo_Pointer(); + t.m_next = typeid(int); + + int* a = new int; + int* b = new int; + *a = -10; + *b = 10; + + if(-1 < t.compare(a, b)){ + assert(0); + } + if(t.compare(b, a) < 1){ + assert(0); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typeinfo_03_B.d Wed Apr 04 20:29:33 2007 +0000 @@ -0,0 +1,30 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Madeleine Freudenberg <madou@madou.org> +// @date@ 2007-04-01 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089 +// @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare + +module dstress.run.t.typeinfo_03_B; + +int main(){ + TypeInfo_Pointer t = new TypeInfo_Pointer(); + t.m_next = typeid(int); + + int* a = new int; + int* b = new int; + *a = -10; + *b = int.max; + + if(-1 < t.compare(a, b)){ + assert(0); + } + if(t.compare(b, a) < 1){ + assert(0); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typeinfo_03_C.d Wed Apr 04 20:29:33 2007 +0000 @@ -0,0 +1,29 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Madeleine Freudenberg <madou@madou.org> +// @date@ 2007-04-01 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089 +// @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare + +module dstress.run.t.typeinfo_03_C; + +int main(){ + auto t = typeid(int*); + + int* a = new int; + int* b = new int; + *a = -10; + *b = int.max; + + if(-1 < t.compare(a, b)){ + assert(0); + } + if(t.compare(b, a) < 1){ + assert(0); + } + + return 0; +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typeinfo_03_D.d Wed Apr 04 20:29:33 2007 +0000 @@ -0,0 +1,29 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Madeleine Freudenberg <madou@madou.org> +// @date@ 2007-04-01 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1089 +// @desc@ [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare + +module dstress.run.t.typeinfo_03_D; + +int main(){ + auto t = typeid(int*); + + int* a = new int; + int* b = new int; + *a = -10; + *b = 10; + + if(-1 < t.compare(a, b)){ + assert(0); + } + if(t.compare(b, a) < 1){ + assert(0); + } + + return 0; +} +