gas: macros nested too deep error

Alan Modra amodra@gmail.com
Wed Feb 25 03:57:09 GMT 2026


In commit fc2fcd4f5be3 I changed as as_fatal to as_bad, thinking that
was sufficient.  Revert that change because
  .macro r;r;r;.endm;r
with two recursive invocations in the body results in 2 to the power
max_macro_nest lines of gas output complaining about macro nesting.

	* input-scrub.c (input_scrub_include_sb): Revert last change.

diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index 2b90632040b..95252b26c6e 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -298,10 +298,7 @@ input_scrub_include_sb (sb *from, char *position, enum expansion expansion)
   if (expansion != expanding_app)
     {
       if (macro_nest > max_macro_nest)
-	{
-	  as_bad (_("macros nested too deeply"));
-	  return;
-	}
+	as_fatal (_("macros nested too deeply"));
       ++macro_nest;
     }
 

-- 
Alan Modra


More information about the Binutils mailing list