|
|
|
|
|
by a1369209993
2032 days ago
|
|
Not sure about Microsoft higher-ups in particular, but C++ and related compilers are notoriously bad (in fact negatively good) at enforcing the assumptions they use for optimization. Eg: void foo(bar_t* p)
{
baz_t* q = &p->baz;
if(!p) panic("...");
do_stuff(p,q);
}
A (stereo-)typical C++ compiler will assume that p is non-null, then actively remove the code checking that. Surprise! You now have a security vulnerability. But only when optimisations are turned on, so if you have distinct debug and release modes, your testing and other debugging systems will be useless.I suspect this is a recurring source of vociferous opponents of allowing any information to be used for optimization, regardless of how much compilers promise that this time is totally different and they'll definitely actually check that it's correct before using it. |
|