Bug 47240 - Compiler crashes upon encountering e := e;
Compiler crashes upon encountering e := e;
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
http://cs.atu.edu/~morell/error.html
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-03 21:20 EDT by Larry Morell
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-25 09:50:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Larry Morell 2001-07-03 21:20:38 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2 i586)

Description of problem:
Compiling:
  int get (int &e){ e := e; }

crashes the compiler;  evidence is supplied on
http://cs.atu.edu/~morell/error.html

How reproducible:
Always

Steps to Reproduce:
1. Put the line   int get (int &e){ e := e; } in a file by itself.  I
called it a.cc
2.  g++ a.cc
3.
	

Actual Results:  g++ a.cc
a.cc: In function `int get (int &)':
a.cc:1: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


Expected Results:  $ g++ a.cc                                        
a.cc: In function `int get(int &)':
a.cc:1: parse error before `='
#  This is the compiler that succeed (older version)
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)


Additional info:

$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)

This is the compiler that failed
Comment 1 Jakub Jelinek 2001-07-25 09:50:26 EDT
Should be fixed by
2001-07-25  Jakub Jelinek  <jakub@redhat.com>

        * lex.c (real_yylex): Don't crash on :=.

        * g++.old-deja/g++.other/crash60.C: New test.

--- gcc/cp/lex.c.jj     Tue Jul 24 20:41:16 2001
+++ gcc/cp/lex.c        Wed Jul 25 16:00:52 2001
@@ -4564,7 +4564,10 @@ real_yylex ()
              case '=':
                value = EQCOMPARE; yylval.code = EQ_EXPR; goto done;
              }
-           value = ASSIGN; goto done;
+           if (c != ':')
+             {
+               value = ASSIGN; goto done;
+             }
          }
        else if (c == c1)
          switch (c)
--- gcc/testsuite/g++.old-deja/g++.other/crash60.C.jj   Wed Jul 25 16:06:37 2001
+++ gcc/testsuite/g++.old-deja/g++.other/crash60.C      Wed Jul 25 16:07:09 2001
@@ -0,0 +1,7 @@
+// Build don't link:
+
+void foo ()
+{
+  int e;
+  e := e;      // ERROR - parse error
+}

(this bug was introduced in July 1999 and went away in September 2000 in
CVS gcc with introduction of integrated preprocessor.
This patch will make it into gcc-2.96-96.

Note You need to log in before you can comment on or make changes to this bug.