From 808811a36951c6bc2ee9d56124603d7ef88a019e Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 20 Oct 2017 11:45:19 +0100 Subject: Improve handling of REPT pseudo op with a negative count. PR 22324 * read.c (s_rept): Use size_t type for count parameter. (do_repeat): Change type of count parameter to size_t. Issue an error is the count parameter is negative. (do_repeat_with_expression): Likewise. * read.h: Update prototypes for do_repeat and do_repeat_with_expression. * doc/as.texinfo (Rept): Document that a zero count is allowed but negative counts are not. * config/tc-rx.c (rx_rept): Use size_t type for count parameter. * config/tc-tic54x.c (tic54x_loop): Cast count parameter to size_t type. * testsuite/gas/macros/end.s: Add a test using a negative repeat count. * testsuite/gas/macros/end.l: Add expected error message. --- gas/read.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gas/read.h') diff --git a/gas/read.h b/gas/read.h index e83118f..f16455d 100644 --- a/gas/read.h +++ b/gas/read.h @@ -146,8 +146,8 @@ extern void stabs_generate_asm_file (void); extern void stabs_generate_asm_lineno (void); extern void stabs_generate_asm_func (const char *, const char *); extern void stabs_generate_asm_endfunc (const char *, const char *); -extern void do_repeat (int,const char *,const char *); -extern void do_repeat_with_expander (int, const char *, const char *, const char *); +extern void do_repeat (size_t, const char *, const char *); +extern void do_repeat_with_expander (size_t, const char *, const char *, const char *); extern void end_repeat (int); extern void do_parse_cons_expression (expressionS *, int); -- cgit v1.1