# HG changeset patch # User thomask # Date 1175718573 0 # Node ID 6666662e436331bd61a85e3048dbadf20f2d4511 # Parent b0b70172c68b00ebdc5121c1c424608d5131be7b [Issue 1089] Unsafe pointer comparison in TypeInfo_Pointer.compare Madeleine Freudenberg 2007-04-01 http://d.puremagic.com/issues/show_bug.cgi?id=1089 diff -r b0b70172c68b -r 6666662e4363 reporter.txt --- 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 , Luís Marques Lukas Pinkowski +Madeleine Freudenberg Manfred Nowak Manuel König marko @@ -166,6 +167,7 @@ Vathix , , Victor Nakoryakov Vladimir +Vladimir Walter Witold Baryluk xs0 diff -r b0b70172c68b -r 6666662e4363 run/t/typeinfo_03_A.d --- /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 +// @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; +} + diff -r b0b70172c68b -r 6666662e4363 run/t/typeinfo_03_B.d --- /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 +// @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; +} + diff -r b0b70172c68b -r 6666662e4363 run/t/typeinfo_03_C.d --- /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 +// @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; +} + diff -r b0b70172c68b -r 6666662e4363 run/t/typeinfo_03_D.d --- /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 +// @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; +} +