mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
Fix -Wmaybe-uninitialized warning in opcodes/i386-dis.c
A recent change in opcodes/i386-dis.c caused a build failure on my
x86-64 Fedora 36 system, which uses:
$ gcc --version
gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
[...]
The error is:
../../binutils-gdb/opcodes/i386-dis.c: In function ‘OP_J’:
../../binutils-gdb/opcodes/i386-dis.c:12705:22: error: ‘val’ may be used uninitialized [-Werror=maybe-uninitialized]
12705 | disp = val & 0x8000 ? val - 0x10000 : val;
| ~~~~^~~~~~~~
This patch fixes the warning.
opcodes/ChangeLog
2023-04-21 Tom Tromey <tromey@adacore.com>
* i386-dis.c (OP_J): Check result of get16.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2023-04-21 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* i386-dis.c (OP_J): Check result of get16.
|
||||
|
||||
2023-04-12 Claudiu Zissulescu <claziss@synopsys.com>
|
||||
|
||||
* arc-tbl.h: Remove vadds2, vadds2h, vadds4h, vaddsubs,
|
||||
|
||||
@@ -12701,7 +12701,8 @@ OP_J (instr_info *ins, int bytemode, int sizeflag)
|
||||
{
|
||||
int val;
|
||||
|
||||
get16 (ins, &val);
|
||||
if (!get16 (ins, &val))
|
||||
return false;
|
||||
disp = val & 0x8000 ? val - 0x10000 : val;
|
||||
/* In 16bit mode, address is wrapped around at 64k within
|
||||
the same segment. Otherwise, a data16 prefix on a jump
|
||||
|
||||
Reference in New Issue
Block a user