digitalmars.D.learn - dmd2 assertion failure when comparing pointers
- Matthias Pleh (15/15) Feb 21 2011 Maybe a little stupid, but I get an assert when I try to compare a valid...
- bearophile (5/6) Feb 21 2011 Added:
- Matthias Pleh (2/8) Feb 21 2011 Ah, thanks!
Maybe a little stupid, but I get an assert when I try to compare a valid
pointer with an int casted pointer.
I know, I could compare the pointer itself, but shouldn't is-poerator
also work?
Also, shouldn't an assert always reproted as a bug?
struct Test {}
void main()
{
Test t,t2;
bool a = &t is &t2; // -> works!
bool b = cast(Test*)1 is &t;
// -> Assertion failure: '0' on line 875 in file 'constfold.c'
}
greets
Matthias
Feb 21 2011
Matthias Pleh:Also, shouldn't an assert always reproted as a bug?Added: http://d.puremagic.com/issues/show_bug.cgi?id=5633 Bye, bearophile
Feb 21 2011
Am 21.02.2011 19:00, schrieb bearophile:Matthias Pleh:Ah, thanks!Also, shouldn't an assert always reproted as a bug?Added: http://d.puremagic.com/issues/show_bug.cgi?id=5633 Bye, bearophile
Feb 21 2011








Matthias Pleh <sufu alter.com>