2018-07-30 Tom Tromey <tom@tromey.com>

* cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263069 138bc75d-0d04-0410-961f-82ee72b054a4
This commit is contained in:
tromey 2018-07-30 13:47:01 +00:00
parent 6c7525a4de
commit a3629d6b67
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2018-07-30 Tom Tromey <tom@tromey.com>
* cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.
2018-07-26 Martin Liska <mliska@suse.cz>
PR lto/86548

View File

@ -4471,7 +4471,8 @@ remember_Btype (struct work_stuff *work, const char *start,
char *tem;
tem = XNEWVEC (char, len + 1);
memcpy (tem, start, len);
if (len > 0)
memcpy (tem, start, len);
tem[len] = '\0';
work -> btypevec[index] = tem;
}