This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Crash in alias.c
- To: egcs-patches at cygnus dot com
- Subject: Crash in alias.c
- From: Bernd Schmidt <crux at Pool dot Informatik dot RWTH-Aachen dot DE>
- Date: Thu, 28 May 1998 11:33:31 +0200 (MET DST)
While playing with the loop patch (see my previous email), I got a
segmentation fault in find_base_value. This function uses REGNO(src) to
index into new_reg_base_value without checking that this regno is within
the range of the array. Since I couldn't convince myself that this shouldn't
be able to happen, I added the following test.
Bernd
* alias.c (find_base_value, case REG): Avoid crash if REGNO (src)
out of bounds for new_reg_base_value.
diff -u -r1.1.1.16 alias.c
--- alias.c 1998/05/26 15:23:12 1.1.1.16
+++ alias.c 1998/05/27 15:08:58
@@ -115,6 +115,9 @@
return src;
case REG:
+ if (REGNO (src) >= reg_base_value_size)
+ return src;
+
/* At the start of a function argument registers have known base
values which may be lost later. Returning an ADDRESS
expression here allows optimization based on argument values