PR 32721, internal error in tc-i386.c:parse_register
Alan Modra
amodra@gmail.com
Thu Feb 20 01:33:05 GMT 2025
More information about the Binutils mailing list
Thu Feb 20 01:33:05 GMT 2025
- Previous message (by thread): [PATCH v3 0/2] RISC-V: Fix abort when displaying data and add test
- Next message (by thread): PR 32721, internal error in tc-i386.c:parse_register
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
pr30117 showed one of the assertions added by 4d1bb7955a8b was too
strict. oss-fuzz also found the second assertion to be too strict,
with this testcase distilled from 7k of garbage source:
A=%eax%%!
Y=A
Z=A
or $6,Z
PR 32721
* config/tc-i386.c (parse_register): Move "know" into
condition. Simplify.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 9cfc4df1e10..53743fb4d7f 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -16838,10 +16838,9 @@ parse_register (const char *reg_string, char **end_op)
{
const expressionS *e = symbol_get_value_expression (symbolP);
- if (e->X_op == O_register)
+ if (e->X_op == O_register
+ && (valueT) e->X_add_number < i386_regtab_size)
{
- know (e->X_add_number >= 0
- && (valueT) e->X_add_number < i386_regtab_size);
r = i386_regtab + e->X_add_number;
*end_op = (char *) reg_string + (input_line_pointer - buf);
}
--
Alan Modra
- Previous message (by thread): [PATCH v3 0/2] RISC-V: Fix abort when displaying data and add test
- Next message (by thread): PR 32721, internal error in tc-i386.c:parse_register
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list