This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12640] [tree-ssa] strlen builtin causes stack overflow building tk
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Nov 2003 17:57:58 -0000
- Subject: [Bug optimization/12640] [tree-ssa] strlen builtin causes stack overflow building tk
- References: <20031016144712.12640.green@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2003-11-12 17:57 -------
Just an infinite loop in tree-ssa-ccp.c:get_strlen()
Smaller test case:
typedef struct PendingCommand
{
char *result;
struct PendingCommand *nextPtr;
} PendingCommand;
static void
SendEventProc (char *resultString)
{
char *p;
PendingCommand *pc, *pcPtr;
resultString = "";
while (*p == '-')
{
if (p[2] == ' ')
{
resultString = p + 3;
}
}
for (pcPtr = pc; pcPtr != ((void *) 0); pcPtr = pcPtr->nextPtr)
{
pcPtr->result = malloc (strlen (resultString) + 1);
strcpy (pcPtr->result, resultString);
}
}
Diego, your patch/function cause this, perhaps you can have a look?
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-11-12 17:57:58
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12640