From 46021a61e42fcda467a7092b03b65095c57f2bc5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 31 Aug 2020 14:36:34 +0930 Subject: [PATCH] PR26471 UBSAN: tc-metag.c:7038 left shift cannot be represented PR 26471 * config/tc-metag.c (md_chars_to_number): Make retval unsigned. --- gas/ChangeLog | 5 +++++ gas/config/tc-metag.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 7b6b28dcf04..9b95d5166df 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-08-31 Alan Modra + + PR 26471 + * config/tc-metag.c (md_chars_to_number): Make retval unsigned. + 2020-08-31 Alan Modra PR 26468 diff --git a/gas/config/tc-metag.c b/gas/config/tc-metag.c index 2816640b29e..1e923415a00 100644 --- a/gas/config/tc-metag.c +++ b/gas/config/tc-metag.c @@ -7030,7 +7030,7 @@ tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) static unsigned int md_chars_to_number (char *val, int n) { - int retval; + unsigned int retval; unsigned char * where = (unsigned char *) val; for (retval = 0; n--;) -- 2.30.2