From f242c0a5c0415bda56f33a13ef65e962ac995797 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 25 May 2011 14:07:38 +0200 Subject: lto-streamer-out.c (output_record_start): Use lto_output_enum * lto-streamer-out.c (output_record_start): Use lto_output_enum (lto_output_tree): Use output_record_start. * lto-streamer-in.c (input_record_start): Use lto_input_enum (lto_get_pickled_tree): Use input_record_start. * lto-section-in.c (lto_section_overrun): Turn into fatal error. (lto_value_range_error): New function. * lto-streamer.h (lto_value_range_error): Declare. (lto_output_int_in_range, lto_input_int_in_range): New functions. (lto_output_enum, lto_input_enum): New macros. From-SVN: r174186 --- gcc/lto-section-in.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gcc/lto-section-in.c') diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c index 4b88fb1..b6277a3 100644 --- a/gcc/lto-section-in.c +++ b/gcc/lto-section-in.c @@ -483,6 +483,16 @@ lto_get_function_in_decl_state (struct lto_file_decl_data *file_data, void lto_section_overrun (struct lto_input_block *ib) { - internal_error ("bytecode stream: trying to read %d bytes " - "after the end of the input buffer", ib->p - ib->len); + fatal_error ("bytecode stream: trying to read %d bytes " + "after the end of the input buffer", ib->p - ib->len); +} + +/* Report out of range value. */ + +void +lto_value_range_error (const char *purpose, HOST_WIDE_INT val, + HOST_WIDE_INT min, HOST_WIDE_INT max) +{ + fatal_error ("%s out of range: Range is %i to %i, value is %i", + purpose, (int)min, (int)max, (int)val); } -- cgit v1.1