This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix alpha assembler crash


On Mon, Nov 24, 2003 at 12:52:55AM +0100, Jakub Bogusz wrote:
> Hello,
> 
> I noticed that as from binutils 2.14.90.0.7 segfaults on alpha-linux on
> some wrongly generated file. It appeared that file had two '.end' for
> one function; but SEGV occurs in even simpler case, where '.end' is not
> preceded with '.ent' - just after error message:
> 
> $ ~/gdb --args rpm/BUILD/binutils-2.14.90.0.7/gas/.libs/as-new as-test.S
> [...]

This patch fixes the assembler crash.


H.J.
----
2003-11-24  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-alpha.c (s_alpha_end): Don't crash if there is no
	matching .ent.

--- gas/config/tc-alpha.c.ent	2003-11-24 11:56:53.000000000 -0800
+++ gas/config/tc-alpha.c	2003-11-24 14:20:45.000000000 -0800
@@ -4494,7 +4494,7 @@ s_alpha_end (dummy)
 	    as_warn (_(".end directive names different symbol than .ent"));
 
 	  /* Create an expression to calculate the size of the function.  */
-	  if (sym)
+	  if (sym && cur_frame_data)
 	    {
 	      OBJ_SYMFIELD_TYPE *obj = symbol_get_obj (sym);
 	      expressionS *exp = xmalloc (sizeof (expressionS));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]