From 3c45a255a86c02939babfaf270721cffa9189b26 Mon Sep 17 00:00:00 2001 From: Arnold Metselaar Date: Sun, 25 Oct 2009 16:15:19 +0000 Subject: [PATCH] * config/tc-z80.c (z80_start_line_hook): Fix parsing of 'equ' or 'defl' in cases where the space between the keyword and the expression has been scrubbed away. Do not check whether a symbol is redefined with 'equ' here; the function equals takes an argument indicating whether redefinitions are allowed. Only call LISTING_NEWLINE if needed, and then after the call to bump_line_counters. --- gas/ChangeLog | 11 +++++++++++ gas/config/tc-z80.c | 17 ++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index c62d4f7dd67..07888e773b8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2009-10-25 Arnold Metselaar + + * config/tc-z80.c (z80_start_line_hook): Fix parsing of 'equ' or + 'defl' in cases where the space between the keyword and the + expression has been scrubbed away. + Do not check whether a symbol is redefined with 'equ' here; + the function equals takes an argument indicating whether + redefinitions are allowed. + Only call LISTING_NEWLINE if needed, and then after the call to + bump_line_counters. + 2009-10-25 Maciej W. Rozycki * doc/as.texinfo (Overview): Move -mfix7000/-mno-fix7000 to diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c index d8bd59ff3b7..e2ea462a52e 100644 --- a/gas/config/tc-z80.c +++ b/gas/config/tc-z80.c @@ -253,10 +253,8 @@ z80_start_line_hook (void) { char c, *rest, *line_start; int len; - symbolS * symbolP; line_start = input_line_pointer; - LISTING_NEWLINE (); if (ignore_input ()) return 0; @@ -275,20 +273,17 @@ z80_start_line_hook (void) len = 4; else len = 0; - if (len && (rest[len] == ' ' || rest[len] == '\t')) + if (len && (!ISALPHA(rest[len]) ) ) { /* Handle assignment here. */ - input_line_pointer = rest + len; if (line_start[-1] == '\n') - bump_line_counters (); - /* Most Z80 assemblers require the first definition of a - label to use "EQU" and redefinitions to have "DEFL". */ - if (len == 3 && (symbolP = symbol_find (line_start)) != NULL) { - if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP)) - as_bad (_("symbol `%s' is already defined"), line_start); + bump_line_counters (); + LISTING_NEWLINE (); } - equals (line_start, 1); + input_line_pointer = rest + len - 1; + /* Allow redefining with "DEFL" (len == 4), but not with "EQU". */ + equals (line_start, len == 4); return 1; } else -- 2.30.2