This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java/2066: Source parser segfault in resolve_package



>Number:         2066
>Category:       java
>Synopsis:       Source parser segfault in resolve_package
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 23 02:46:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        gcc version 3.0 20010222 (prerelease)
>Organization:
>Environment:

>Description:
Compile the test case below. The compiler will crash:

Crash.java: In method `Crash.a()':
Crash.java:14: Internal error: Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
0x08060ba1 in resolve_package (pkg=0x401a5340, next=0xbffff528) at parse.y:6725
6725      const char *name = IDENTIFIER_POINTER (EXPR_WFL_NODE (pkg));

#0  0x08060ba1 in resolve_package (pkg=0x401a5340, next=0xbffff528)
    at parse.y:6725
#1  0x08068077 in resolve_qualified_expression_name (wfl=0x401a5340, 
    found_decl=0xbffff558, where_found=0xbffff55c, type_found=0xbffff560)
    at parse.y:9290
#2  0x080678ce in resolve_field_access (qual_wfl=0x401a5340, field_decl=0x0, 
    field_type=0x0) at parse.y:8931
#3  0x0806743e in resolve_expression_name (id=0x401a5340, orig=0x0)
    at parse.y:8895
#4  0x080710ad in java_complete_lhs (node=0x401a5340) at parse.y:11427
[...]

The problem here is that EXPR_WFL_NODE (pkg) evaluates to
NULL.
>How-To-Repeat:
public class Crash
{
  class Foo
  {
    int afield;
    Foo f;
  }
  
  Foo c;
  Foo d;
   
  void a()
  {
    int i = (c.f = d).afield;
  }
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]