Article View: gnu.g++.bug
Article #1647fix for g++ segmentation fault
From: "Douglas C. Schmidt"
Date: Thu, 19 Jan 1989 10:49
Date: Thu, 19 Jan 1989 10:49
48 lines
2189 bytes
2189 bytes
Hi,
G++ 1.32 fails when presented with strange input like this:
----------------------------------------
typedef int *win_error_function(int, int);
int win_errorhandler(win_error_function);
----------------------------------------
The following patches fix this problem:
----------------------------------------
*** cplus-decl.c.~1~ Tue Jan 17 23:07:21 1989
--- cplus-decl.c Thu Jan 19 02:40:53 1989
***************
*** 4245,4256 ****
if (TREE_CODE (type) == FUNCTION_TYPE)
{
! error ("parameter `%s' invalidly declared function type", IDENTIFIER_POINTER (declarator));
type = build_pointer_type (type);
}
else if (TREE_CODE (type) == MEMBER_TYPE)
{
! error ("parameter `%s' invalidly declared member type", IDENTIFIER_POINTER (declarator));
type = build_pointer_type (type);
}
--- 4245,4262 ----
if (TREE_CODE (type) == FUNCTION_TYPE)
{
! if (declarator == NULL_TREE)
! error ("formal parameter invalidly declared function type");
! else
! error ("parameter `%s' invalidly declared function type", IDENTIFIER_POINTER (declarator));
type = build_pointer_type (type);
}
else if (TREE_CODE (type) == MEMBER_TYPE)
{
! if (declarator == NULL_TREE)
! error ("formal parameter invalidly declared member type");
! else
! error ("parameter `%s' invalidly declared member type", IDENTIFIER_POINTER (declarator));
type = build_pointer_type (type);
}
Technical Details
Message-ID:
<8901190257.aa27187@PARIS.ICS.UCI.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.eduShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!PARIS.ICS.UCI.EDU!schmidt%crimee.ics.uci.edu
From: schmidt%crimee.ics.uci.edu@PARIS.ICS.UCI.EDU ("Douglas C. Schmidt")
Newsgroups: gnu.g++.bug
Subject: fix for g++ segmentation fault
Message-ID: <8901190257.aa27187@PARIS.ICS.UCI.EDU>
Date: 19 Jan 89 10:49:22 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 48