This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Integer overflow in overlap_subvar
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Jul 2005 14:47:33 +0200 (CEST)
- Subject: [PATCH] Integer overflow in overlap_subvar
Looks obvious - but well. Bootstrapped and regtested on
i686-pc-linux-gnu.
Ok for mainline?
Thanks,
Richard.
2005-07-25 Richard Guenther <rguenther@suse.de>
* tree-flow-inline.h (overlap_subvar): Protect against
possible overflow.
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.53
diff -u -c -3 -p -r2.53 tree-flow-inline.h
*** tree-flow-inline.h 19 Jul 2005 03:36:13 -0000 2.53
--- tree-flow-inline.h 25 Jul 2005 08:16:57 -0000
*************** overlap_subvar (unsigned HOST_WIDE_INT o
*** 1518,1524 ****
{
return true;
}
! else if (offset < sv->offset && (offset + size > sv->offset))
{
return true;
}
--- 1517,1523 ----
{
return true;
}
! else if (offset < sv->offset && (size > sv->offset - offset))
{
return true;
}