Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 106131 Details for
Bug 232565
[1.5][compiler] wrong autoboxing code generation leads to VerifyError at runtime
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Better patch for 3.4.x
232565-34x.txt (text/plain), 7.76 KB, created by
Philipe Mulet
on 2008-06-30 12:52:41 EDT
(
hide
)
Description:
Better patch for 3.4.x
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2008-06-30 12:52:41 EDT
Size:
7.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java,v >retrieving revision 1.103 >diff -u -r1.103 SingleNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 26 May 2008 10:46:57 -0000 1.103 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 30 Jun 2008 16:52:03 -0000 >@@ -606,23 +606,28 @@ > codeStream.invokestatic(this.syntheticAccessors[SingleNameReference.READ]); > } > } >+ TypeBinding operandType; >+ if (this.genericCast != null) { >+ codeStream.checkcast(this.genericCast); >+ operandType = this.genericCast; >+ } else { >+ operandType = fieldBinding.type; >+ } > if (valueRequired) { > if (fieldBinding.isStatic()) { >- if ((fieldBinding.type == TypeBinding.LONG) || (fieldBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2(); > } else { > codeStream.dup(); > } > } else { // Stack: [owner][old field value] ---> [old field value][owner][old field value] >- if ((fieldBinding.type == TypeBinding.LONG) || (fieldBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2_x1(); > } else { > codeStream.dup_x1(); > } > } > } >- if (this.genericCast != null) >- codeStream.checkcast(this.genericCast); > codeStream.generateImplicitConversion(this.implicitConversion); > codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion); > codeStream.sendOperator(postIncrement.operator, this.implicitConversion & TypeIds.COMPILE_TYPE_MASK); >@@ -655,7 +660,6 @@ > codeStream.generateConstant(postIncrement.expression.constant, this.implicitConversion); > codeStream.sendOperator(postIncrement.operator, this.implicitConversion & TypeIds.COMPILE_TYPE_MASK); > codeStream.generateImplicitConversion(postIncrement.preAssignImplicitConversion); >- > codeStream.store(localBinding, false); > } > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v >retrieving revision 1.116 >diff -u -r1.116 FieldReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 27 May 2008 22:21:13 -0000 1.116 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 30 Jun 2008 16:52:03 -0000 >@@ -359,25 +359,30 @@ > codeStream.invokestatic(this.syntheticAccessors[FieldReference.READ]); > } > } >+ TypeBinding operandType; >+ if (this.genericCast != null) { >+ codeStream.checkcast(this.genericCast); >+ operandType = this.genericCast; >+ } else { >+ operandType = this.codegenBinding.type; >+ } > if (valueRequired) { > if (isStatic) { >- if ((this.codegenBinding.type == TypeBinding.LONG) >- || (this.codegenBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) >+ || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2(); > } else { > codeStream.dup(); > } > } else { // Stack: [owner][old field value] ---> [old field value][owner][old field value] >- if ((this.codegenBinding.type == TypeBinding.LONG) >- || (this.codegenBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) >+ || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2_x1(); > } else { > codeStream.dup_x1(); > } > } > } >- if (this.genericCast != null) >- codeStream.checkcast(this.genericCast); > codeStream.generateImplicitConversion(this.implicitConversion); > codeStream.generateConstant( > postIncrement.expression.constant, >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v >retrieving revision 1.125 >diff -u -r1.125 QualifiedNameReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 27 May 2008 22:21:13 -0000 1.125 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 30 Jun 2008 16:52:03 -0000 >@@ -520,27 +520,32 @@ > codeStream.invokestatic(accessor); > } > } >+ TypeBinding requiredGenericCast = getGenericCast(this.otherCodegenBindings == null ? 0 : this.otherCodegenBindings.length); >+ TypeBinding operandType; >+ if (requiredGenericCast != null) { >+ codeStream.checkcast(requiredGenericCast); >+ operandType = requiredGenericCast; >+ } else { >+ operandType = lastFieldBinding.type; >+ } > // duplicate the old field value > if (valueRequired) { > if (lastFieldBinding.isStatic()) { >- if ((lastFieldBinding.type == TypeBinding.LONG) >- || (lastFieldBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) >+ || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2(); > } else { > codeStream.dup(); > } > } else { // Stack: [owner][old field value] ---> [old field value][owner][old field value] >- if ((lastFieldBinding.type == TypeBinding.LONG) >- || (lastFieldBinding.type == TypeBinding.DOUBLE)) { >+ if ((operandType == TypeBinding.LONG) >+ || (operandType == TypeBinding.DOUBLE)) { > codeStream.dup2_x1(); > } else { > codeStream.dup_x1(); > } > } > } >- TypeBinding requiredGenericCast = getGenericCast(this.otherCodegenBindings == null ? 0 : this.otherCodegenBindings.length); >- if (requiredGenericCast != null) codeStream.checkcast(requiredGenericCast); >- > codeStream.generateImplicitConversion(this.implicitConversion); > codeStream.generateConstant( > postIncrement.expression.constant, >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java,v >retrieving revision 1.114 >diff -u -r1.114 AutoBoxingTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java 10 Jun 2008 22:34:42 -0000 1.114 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java 30 Jun 2008 16:52:05 -0000 >@@ -4560,7 +4560,7 @@ > "----------\n"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 >-public void _test154() { >+public void test154() { > this.runConformTest( > new String[] { > "X.java", >@@ -4592,7 +4592,7 @@ > "000"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 - variation >-public void _test155() { >+public void test155() { > this.runConformTest( > new String[] { > "X.java", >@@ -4624,7 +4624,7 @@ > "000"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 - variation >-public void _test156() { >+public void test156() { > this.runConformTest( > new String[] { > "X.java", >@@ -4643,7 +4643,7 @@ > "HIdone"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 - variation >-public void _test157() { >+public void test157() { > this.runConformTest( > new String[] { > "X.java", >@@ -4663,7 +4663,7 @@ > "HIdone"); > } > //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232565 - variation >-public void _test158() { >+public void test158() { > this.runConformTest( > new String[] { > "X.java",
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 232565
:
101778
| 106131