From 829b08e405a4da9f28e2ce9c386a607b6960037b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 31 May 2025 13:49:24 +0930 Subject: [PATCH] weakref gas internal error This horrible testcase (cleaned up from oss-fuzz) r=x*2 x=r-r .weakref r,x r=r-5 triggers resolve_symbol_value "gas_assert (final_val == 0)" in weakref handling. * read.c (assign_symbol): Clear weakrefr. --- gas/read.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gas/read.c b/gas/read.c index 145a39c8652..c9cbd224a7d 100644 --- a/gas/read.c +++ b/gas/read.c @@ -3306,6 +3306,7 @@ assign_symbol (char *name, int mode) retain the value of the symbol at the point of use. */ else if (S_IS_VOLATILE (symbolP)) symbolP = symbol_clone (symbolP, 1); + S_CLEAR_WEAKREFR (symbolP); } if (mode == 0) -- 2.39.5