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]
Other format: [Raw text]

java/5179: Qualifed static field access doesn't initialize its class



>Number:         5179
>Category:       java
>Synopsis:       Qualifed static field access doesn't initialize its class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 22 16:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        gcc version 3.1 20011221 (experimental)
>Organization:
>Environment:

>Description:
The following test case crashes because no class initialization for "Bar" is generated.
>How-To-Repeat:
class Bar
{
  static Bar B = new Bar();
  int i = 1;
}

public class Qual2
{
  public static void main(String[] args)
  {
    System.out.println (Bar.B.i);    // crash
    System.out.println ((Bar.B).i);  // crash    
  }
}
>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]