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 78443 Details for
Bug 200158
[compiler] inconsistent handling of unreachable code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Suggested fix
patch.txt (text/plain), 3.09 KB, created by
Maxime Daniel
on 2007-09-14 11:43:14 EDT
(
hide
)
Description:
Suggested fix
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2007-09-14 11:43:14 EDT
Size:
3.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java,v >retrieving revision 1.23 >diff -u -r1.23 FlowAnalysisTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 14 Sep 2007 12:56:45 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/FlowAnalysisTest.java 14 Sep 2007 15:40:33 -0000 >@@ -1364,7 +1364,7 @@ > // labeled loop > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=200158 > // contrast this with test049 >-public void _test048() { >+public void test048() { > runTest( > new String[] { > "X.java", >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java,v >retrieving revision 1.37 >diff -u -r1.37 LabeledStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java 5 Oct 2006 06:33:38 -0000 1.37 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java 14 Sep 2007 15:40:41 -0000 >@@ -51,26 +51,23 @@ > } else { > LabelFlowContext labelContext; > FlowInfo statementInfo, mergedInfo; >- if (((statementInfo = statement >- .analyseCode( >- currentScope, >- (labelContext = >- new LabelFlowContext( >- flowContext, >- this, >- label, >- (targetLabel = new BranchLabel()), >- currentScope)), >- flowInfo)).tagBits & FlowInfo.UNREACHABLE) != 0) { >- if ((labelContext.initsOnBreak.tagBits & FlowInfo.UNREACHABLE) == 0) { >- // an embedded loop has had no chance to reinject forgotten null info >- mergedInfo = flowInfo.unconditionalCopy(). >- addInitializationsFrom(labelContext.initsOnBreak); >- } else { >- mergedInfo = labelContext.initsOnBreak; >- } >- } else { >- mergedInfo = statementInfo.mergedWith(labelContext.initsOnBreak); >+ statementInfo = statement.analyseCode( >+ currentScope, >+ (labelContext = >+ new LabelFlowContext( >+ flowContext, >+ this, >+ label, >+ (targetLabel = new BranchLabel()), >+ currentScope)), >+ flowInfo); >+ boolean reinjectNullInfo = (statementInfo.tagBits & FlowInfo.UNREACHABLE) != 0 && >+ (labelContext.initsOnBreak.tagBits & FlowInfo.UNREACHABLE) == 0; >+ mergedInfo = statementInfo.mergedWith(labelContext.initsOnBreak); >+ if (reinjectNullInfo) { >+ // an embedded loop has had no chance to reinject forgotten null info >+ ((UnconditionalFlowInfo)mergedInfo).addInitializationsFrom(flowInfo.unconditionalFieldLessCopy()). >+ addInitializationsFrom(labelContext.initsOnBreak.unconditionalFieldLessCopy()); > } > mergedInitStateIndex = > currentScope.methodScope().recordInitializationStates(mergedInfo);
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
Flags:
maxime_daniel
:
review?
Actions:
View
|
Diff
Attachments on
bug 200158
: 78443 |
79879