]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas pending_bundle_size assert
authorAlan Modra <amodra@gmail.com>
Sat, 5 Jul 2025 08:57:36 +0000 (18:27 +0930)
committerAlan Modra <amodra@gmail.com>
Sun, 6 Jul 2025 11:05:50 +0000 (20:35 +0930)
oss-fuzz managed to trigger this assert, by assembling directives in
the absolute section.  Avoid this using similar code to that in
frags.c:frag_new (commit 2dc2dfa7d7a5).

gas/read.c

index d17e171c4c19c56536425d2cb4599c2f5f1c179c..0e04fcbdeea73f6d1482fbb49c6f0c5b4cbcac64 100644 (file)
@@ -712,7 +712,7 @@ pending_bundle_size (fragS *frag)
   if (frag->fr_type == rs_machine_dependent)
     size += md_frag_max_var (frag);
 
-  gas_assert (size >= offset);
+  gas_assert (size >= offset || now_seg == absolute_section);
 
   return size - offset;
 }