Fix static analysis issue found by cppcheck.
	* microblaze-tdep.c (microblaze_extract_return_value): Fix
	uninitialized BUF for size 2.
This commit is contained in:
Jan Kratochvil 2012-02-28 08:14:11 +00:00
parent b36101a8c9
commit 6425366c4b
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-02-28 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix static analysis issue found by cppcheck.
* microblaze-tdep.c (microblaze_extract_return_value): Fix
uninitialized BUF for size 2.
2012-02-27 Chris Dearman <chris@mips.com>
Nathan Froyd <froydnj@codesourcery.com>
Maciej W. Rozycki <macro@codesourcery.com>

View File

@ -562,6 +562,7 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
return;
case 2: /* return last 2 bytes in register. */
regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
return;
case 4: /* for sizes 4 or 8, copy the required length. */