[cfe-dev] Security fail (memset being optimized away)

myLC@gmx.de via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 3 08:42:30 PST 2019


On Jan 3 8:31, Keane Erich wrote:
 > I believe that solution is able to be optimized out as well
 > (see the comment in the C99 solution).
 > memset_s (C11)  and SecureZeroMemory (MSVC) are the two
 > standards compliant ways that guarantee they won't be
 > optimized out.


It doesn't quench my curiosity, though. ;-)
What about other (your own) functions?

Isn't it a bug, if a compiler takes false assumptions on
volatiles? This would mean that it doesn't work, even though
it really should (which, of course, is of little help in the
real world).




More information about the cfe-dev mailing list