This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

expr.c longjmp change



The recent change to builtin longjmp causes the compiler to abort when the
C source code supplies a second argument other than 1.  The compiler
should not abort on erroneous input.  It should report an error.


Fri Jun 12 13:44:48 1998  John Carr  <jfc@mit.edu>

	* expr.c (expand_builtin, case BUILT_IN_LONGJMP): Error if second
	argument not 1.

*** expr.c~	Fri Jun 12 09:41:14 1998
--- expr.c	Fri Jun 12 13:42:11 1998
***************
*** 8937,8942 ****
--- 8937,8947 ----
  				      VOIDmode, 0);
  	  rtx value = expand_expr (TREE_VALUE (TREE_CHAIN (arglist)),
  				   NULL_RTX, VOIDmode, 0);
+ 	  if (value != const1_rtx)
+ 	    {
+ 	      error ("__builtin_longjmp second argument must be 1");
+ 	      return const0_rtx;
+ 	    }
  	  expand_builtin_longjmp (buf_addr, value);
  	  return const0_rtx;
  	}



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