This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
exception-section patch, part 2
- To: egcs-patches at cygnus dot com
- Subject: exception-section patch, part 2
- From: Bruno Haible <haible at ilog dot fr>
- Date: Tue, 30 Jun 1998 23:50:10 +0200 (MET DST)
This patch puts in a safety check for the eh_frame table. If gcc emits
empty FDEs (which would be a bug), this causes the program to abort at
startup time instead of crashing mysteriously when the first exception
occurs.
Sun Jun 28 19:49:33 1998 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
* frame.c (add_fdes): Reject empty FDEs.
diff -c3p egcs-19980628/gcc/frame.c.bak egcs-19980628/gcc/frame.c
*** egcs-19980628/gcc/frame.c.bak Wed May 6 23:07:06 1998
--- egcs-19980628/gcc/frame.c Tue Jun 30 13:06:26 1998
*************** add_fdes (fde *this_fde, fde_accumulator
*** 408,413 ****
--- 408,419 ----
if (this_fde->CIE_delta == 0 || this_fde->pc_begin == 0)
continue;
+ /* Reject empty FDEs. They would lead to trouble in find_fde(),
+ because find_fde() assumes that no two FDEs have the same pc_begin
+ value. */
+ if (this_fde->pc_range == 0)
+ abort ();
+
fde_insert (accu, this_fde);
if (this_fde->pc_begin < pc_begin)