Article View: gnu.g++.bug
Article #1646Bug report, and FIX!
From: "Douglas C. Schmidt"
Date: Thu, 19 Jan 1989 10:27
Date: Thu, 19 Jan 1989 10:27
54 lines
2481 bytes
2481 bytes
Hi,
There is currently a bug in the g++ 1.32 cplus-parse.y file.
It causes a segmentation fault with the following construct:
----------------------------------------
main () {
int j = ({1;});
}
----------------------------------------
I've found the problem with this, and included the patches
for cplus-parse.y below.
Doug
----------------------------------------
*** cplus-parse.y.~1~ Thu Jan 19 02:24:22 1989
--- cplus-parse.y Thu Jan 19 02:21:14 1989
***************
*** 641,647 ****
compstmt ')'
{ if (pedantic)
warning ("ANSI C forbids braced-groups within expressions");
! expand_end_stmt_expr ($<ttype>2); }
| primary '(' exprlist ')'
{ $$ = build_x_function_call ($1, $3, current_class_decl); }
| primary '[' expr ']'
--- 641,647 ----
compstmt ')'
{ if (pedantic)
warning ("ANSI C forbids braced-groups within expressions");
! $$ = expand_end_stmt_expr ($<ttype>2); }
| primary '(' exprlist ')'
{ $$ = build_x_function_call ($1, $3, current_class_decl); }
| primary '[' expr ']'
***************
*** 953,959 ****
compstmt ')'
{ if (pedantic)
warning ("ANSI C forbids braced-groups within expressions");
! expand_end_stmt_expr ($<ttype>2); }
| primary_no_id '(' exprlist ')'
{ $$ = build_x_function_call ($1, $3, current_class_decl); }
| primary_no_id '[' expr ']'
--- 953,959 ----
compstmt ')'
{ if (pedantic)
warning ("ANSI C forbids braced-groups within expressions");
! $$ = expand_end_stmt_expr ($<ttype>2); }
| primary_no_id '(' exprlist ')'
{ $$ = build_x_function_call ($1, $3, current_class_decl); }
| primary_no_id '[' expr ']'
Technical Details
Message-ID:
<8901190235.aa27082@PARIS.ICS.UCI.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!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!mcdchg!rutgers!mailrus!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: Bug report, and FIX!
Message-ID: <8901190235.aa27082@PARIS.ICS.UCI.EDU>
Date: 19 Jan 89 10:27:30 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 54