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

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

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

From-SVN: r263069
This commit is contained in:
Tom Tromey 2018-07-30 13:47:01 +00:00 committed by Tom Tromey
parent cff431d2d9
commit 6ef4752bc9
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;
}