From 2daf4fd8960262b76e597427e2e230b3fe6470b3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 16 Nov 1999 12:27:25 +0000 Subject: * config/tc-i386.c (i386_immediate): Disallow O_big immediates. (i386_displacement): Disallow O_big displacements. --- gas/config/tc-i386.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'gas/config/tc-i386.c') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 1d8f07c..5219113 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2558,7 +2558,7 @@ i386_immediate (imm_start) input_line_pointer = save_input_line_pointer; - if (exp->X_op == O_absent) + if (exp->X_op == O_absent || exp->X_op == O_big) { /* missing or bad expr becomes absolute 0 */ as_bad (_("Missing or invalid immediate expression `%s' taken as 0"), @@ -2567,9 +2567,9 @@ i386_immediate (imm_start) exp->X_add_number = 0; exp->X_add_symbol = (symbolS *) 0; exp->X_op_symbol = (symbolS *) 0; - i.types[this_operand] |= Imm; } - else if (exp->X_op == O_constant) + + if (exp->X_op == O_constant) { int bigimm = Imm32; if (flag_16bit_code ^ (i.prefix[DATA_PREFIX] != 0)) @@ -2808,6 +2808,17 @@ i386_displacement (disp_start, disp_end) RESTORE_END_STRING (disp_end); input_line_pointer = save_input_line_pointer; + if (exp->X_op == O_absent || exp->X_op == O_big) + { + /* missing or bad expr becomes absolute 0 */ + as_bad (_("Missing or invalid displacement expression `%s' taken as 0"), + disp_start); + exp->X_op = O_constant; + exp->X_add_number = 0; + exp->X_add_symbol = (symbolS *) 0; + exp->X_op_symbol = (symbolS *) 0; + } + if (exp->X_op == O_constant) { if (fits_in_signed_byte (exp->X_add_number)) -- cgit v1.1