Re: Detecting bad static casts

2013-01-14 Thread Joshua Cranmer
On 1/14/2013 1:05 PM, Jesse Ruderman wrote: We have a lot of pointer casts in our tree [1][2][3] and some security holes involve these casts going wrong [4][5]. Should we make debug builds check casts to (vtableful?) pointer types? This could be done by adding and calling an "assert_cast" functi

Re: Detecting bad static casts

2013-01-14 Thread Joshua Cranmer
On 1/14/2013 1:05 PM, Jesse Ruderman wrote: We have a lot of pointer casts in our tree [1][2][3] and some security holes involve these casts going wrong [4][5]. Should we make debug builds check casts to (vtableful?) pointer types? This could be done by adding and calling an "assert_cast" functi

Re: Detecting bad static casts

2013-01-14 Thread Benjamin Smedberg
On 1/14/2013 2:05 PM, Jesse Ruderman wrote: Should we make debug builds check casts to (vtableful?) pointer types? This could be done by adding and calling an "assert_cast" function, or by adding a new "sanitizer" mode [6] to clang. In order to keep our custom goop to a minimum, I don't think t

Detecting bad static casts

2013-01-14 Thread Jesse Ruderman
We have a lot of pointer casts in our tree [1][2][3] and some security holes involve these casts going wrong [4][5]. Should we make debug builds check casts to (vtableful?) pointer types? This could be done by adding and calling an "assert_cast" function, or by adding a new "sanitizer" mode [6] to