diff options
author | Jan Hubicka <jh@suse.cz> | 2011-05-25 14:07:38 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-05-25 12:07:38 +0000 |
commit | f242c0a5c0415bda56f33a13ef65e962ac995797 (patch) | |
tree | 1b42ff9de53077e317f6573fb7a0e6580fe3254f /gcc/lto-section-in.c | |
parent | 52d0a7acadc642b26e833dfcaffc22e4d59fb75f (diff) | |
download | gcc-f242c0a5c0415bda56f33a13ef65e962ac995797.zip gcc-f242c0a5c0415bda56f33a13ef65e962ac995797.tar.gz gcc-f242c0a5c0415bda56f33a13ef65e962ac995797.tar.bz2 |
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
Diffstat (limited to 'gcc/lto-section-in.c')
-rw-r--r-- | gcc/lto-section-in.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); } |