Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 151192 Details for
Bug 234157
gcj final variable corrupted in inner class.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
.
pp (text/plain), 3.40 KB, created by
Andrew Haley
on 2007-03-29 12:38:54 UTC
(
hide
)
Description:
.
Filename:
MIME Type:
Creator:
Andrew Haley
Created:
2007-03-29 12:38:54 UTC
Size:
3.40 KB
patch
obsolete
>2007-03-29 Andrew Haley <aph@redhat.com> > > * parse.y (build_alias_initializer_parameter_list): Reorder fields > where necessary. > (class_reordered): New function. > * parse.h (AIPL_CTOR_CREATION): New enum. > >Index: gcc/java/parse.y >=================================================================== >--- gcc/java/parse.y (revision 123182) >+++ gcc/java/parse.y (working copy) >@@ -306,6 +306,7 @@ > static void java_parser_context_suspend (void); > static void java_parser_context_resume (void); > static int pop_current_osb (struct parser_ctxt *); >+static bool class_reordered (tree candidate); > > /* JDK 1.1 work. FIXME */ > >@@ -5491,6 +5492,7 @@ > break; > > case AIPL_FUNCTION_CREATION: >+ case AIPL_CTOR_CREATION: > MANGLE_ALIAS_INITIALIZER_PARAMETER_NAME_STR (purpose, > &buffer [4]); > value = TREE_TYPE (field); >@@ -5528,10 +5530,28 @@ > if (artificial) > *artificial +=1; > } >+ > if (additional_parms) > { >- if (ANONYMOUS_CLASS_P (class_type) >- && mode == AIPL_FUNCTION_CTOR_INVOCATION) >+ /* If we're creating a constructor we don't expect the fields >+ of this class already to have been put into the correct >+ order: we expect them to be reversed because >+ java_reorder_fields() hasn't yet been called. However, >+ under some circumstances reading a dependent source file >+ will cause our own fields to be reordered. This is a bug. >+ >+ Rather than fixing the real bug, (i.e. preventing the reading >+ in of a dependent class from reordering our own fields) we >+ detect the fact that this has happened and compensate >+ here. */ >+ if (mode == AIPL_CTOR_CREATION >+ && ! ANONYMOUS_CLASS_P (class_type) >+ && class_reordered (class_type)) >+ { >+ additional_parms = nreverse (additional_parms); >+ } >+ else if (ANONYMOUS_CLASS_P (class_type) >+ && mode == AIPL_FUNCTION_CTOR_INVOCATION) > additional_parms = nreverse (additional_parms); > parm = chainon (additional_parms, parm); > } >@@ -5567,7 +5587,7 @@ > > /* Some more arguments to be hidden here. The values of the local > variables of the outer context that the inner class needs to see. */ >- parm = build_alias_initializer_parameter_list (AIPL_FUNCTION_CREATION, >+ parm = build_alias_initializer_parameter_list (AIPL_CTOR_CREATION, > class_type, parm, > &artificial); > } >@@ -7748,6 +7768,28 @@ > } > > static GTY(()) tree stop_reordering; >+ >+/* Return true if CANDIDATE is a class whose fields have already been >+ reversed. */ >+ >+static bool >+class_reordered (tree candidate) >+{ >+ tree current; >+ for (current = gclass_list; current; current = TREE_CHAIN (current)) >+ { >+ tree kludge = TREE_TYPE (TREE_VALUE (current)); >+ >+ if (kludge == stop_reordering) >+ break; >+ >+ if (candidate == kludge) >+ return false; >+ } >+ >+ return true; >+} >+ > void > java_reorder_fields (void) > { >Index: gcc/java/parse.h >=================================================================== >--- gcc/java/parse.h (revision 123182) >+++ gcc/java/parse.h (working copy) >@@ -345,6 +345,7 @@ > lists. AIPL stands for Alias Initializer Parameter List. */ > enum { > AIPL_FUNCTION_CREATION, /* Suitable for artificial method creation */ >+ AIPL_CTOR_CREATION, /* Creation of constructor */ > AIPL_FUNCTION_DECLARATION, /* Suitable for declared methods */ > AIPL_FUNCTION_CTOR_INVOCATION, /* Invocation of constructors */ > AIPL_FUNCTION_FINIT_INVOCATION /* Invocation of $finit$ */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 234157
:
151036
|
151037
| 151192