assert codegen bug

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon Apr 9 21:11:38 PDT 2007


I don't know if I can reproduce this in a small amount of code.  This just 
came up in MiniD, and I have _no_ idea if I can get it to happen by 
whittling down the code, considering that it happens with a 5500-line file 
in an even bigger project.

Basically what's happening is that all the asserts in one of my modules 
(minid.types) are giving bogus pointers to the filename to the _d_assert_msg 
function.  The line number and custom message are being passed correctly, 
but the filename parameter is completely messed up, i.e. it's passing the 
value 0x30 as the pointer and some ridiculous value that points to nothing 
as the length.  This means that any time an assert trips in this module I 
get an incredibly hard-to-track-down MAV, which happens in the vsnprintf 
call in std.asserterror.

I've tried versions of DMD back to 1.006 and they all have the same problem, 
so it's not (that) new.

I have no idea what I did to make the asserts mess up like this, since they 
used to work.  I might be able to get to the bottom of this by compiling 
older revisions of MiniD, but.. 




More information about the Digitalmars-d-bugs mailing list