This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/61422] False Asan positive in libopus
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jun 2014 16:05:08 +0000
- Subject: [Bug sanitizer/61422] False Asan positive in libopus
- Auto-submitted: auto-generated
- References: <bug-61422-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61422
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Comment on attachment 32896
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32896
Proposed patch
Can't reproduce it, are you sure you don't have extra patches in the tree
(stringops currently don't use the the real_size_in_bytes != size_in_bytes
accesses).
The fix is good, except for the bogus whitespace after [ and incorrect testcase
(you should be really using "+m" instead of "=m", otherwise the compiler could
optimize away the stores of 1 or 3. Also, please don't add * sizeof (char)
there, that is * 1 by definition. And please use __builtin_memcpy instead of
unprototyped memcpy. And copying around uninitialized bytes probably isn't a
good idea either, so you should first memset it or fill in or something.