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 179283 Details for
Bug 325755
[compiler] wrong initialization state after conditional expression
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix v2 plus tests
Bug_325755_v2.patch (text/plain), 4.93 KB, created by
Stephan Herrmann
on 2010-09-20 16:35:24 EDT
(
hide
)
Description:
fix v2 plus tests
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2010-09-20 16:35:24 EDT
Size:
4.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java,v >retrieving revision 1.68 >diff -u -r1.68 UnconditionalFlowInfo.java >--- compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java 9 Sep 2010 17:36:21 -0000 1.68 >+++ compiler/org/eclipse/jdt/internal/compiler/flow/UnconditionalFlowInfo.java 20 Sep 2010 20:28:39 -0000 >@@ -1520,6 +1520,18 @@ > | na2 & (nb3 | nb2)) > | na2 & b3 & b4 > | a2 & (nb1 & b4 | a3 & na4 & b1) & nb3); >+ // the above formulae do not handle the state 0111, do it now explicitly: >+ long ax = ~a1 & a2 & a3 & a4; >+ long bx = ~b1 & b2 & b3 & b4; >+ long x = ax|bx; >+ if (x != 0) { >+ // restore state 0111 for all variable ids in x: >+ this.nullBit1 &= ~x; >+ this.nullBit2 |= x; >+ this.nullBit3 |= x; >+ this.nullBit4 |= x; >+ } >+ > if (COVERAGE_TEST_FLAG) { > if(CoverageTestId == 30) { > this.nullBit4 = ~0; >@@ -1664,6 +1676,17 @@ > | na2 & (nb3 | nb2)) > | na2 & b3 & b4 > | a2 & (nb1 & b4 | a3 & na4 & b1) & nb3); >+ // the above formulae do not handle the state 0111, do it now explicitly: >+ long ax = ~a1 & a2 & a3 & a4; >+ long bx = ~b1 & b2 & b3 & b4; >+ long x = ax|bx; >+ if (x != 0) { >+ // restore state 0111 for all variable ids in x: >+ this.extra[2][i] &= ~x; >+ this.extra[3][i] |= x; >+ this.extra[4][i] |= x; >+ this.extra[5][i] |= x; >+ } > thisHasNulls = thisHasNulls || > this.extra[3][i] != 0 || > this.extra[4][i] != 0 || >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java,v >retrieving revision 1.103 >diff -u -r1.103 NullReferenceTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 15 Sep 2010 16:09:09 -0000 1.103 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java 20 Sep 2010 20:28:57 -0000 >@@ -13493,4 +13493,73 @@ > null); > } > } >+ >+//null analysis -- conditional expression >+public void testBug325755() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public static Object foo(String s1, String s2) {\n" + >+ " String local1 = s1;\n" + >+ " String local2 = s2;\n" + >+ " \n" + >+ " String local3 = null;\n" + >+ " if (local1 != null && local2 != null)\n" + >+ " local3 = \"\"; //$NON-NLS-1$\n" + >+ " else\n" + >+ " local3 = local1 != null ? local1 : local2;\n" + >+ "\n" + >+ " if (local3 != null)\n" + >+ " return new Integer(local3.length());\n" + >+ " return null;\n" + >+ " }\n" + >+ " \n" + >+ " public static void main(String[] args) {\n" + >+ " System.out.print(foo(null, null));\n" + >+ " System.out.print(foo(\"p1\", null));\n" + >+ " System.out.print(foo(null, \"p2\"));\n" + >+ " System.out.print(foo(\"p1\", \"p2\"));\n" + >+ " }\n" + >+ "}"}, >+ "null220"); >+} >+//null analysis -- conditional expression, many locals >+public void testBug325755b() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public static Object foo(String s1, String s2) {\n" + >+ " int i00, i01, i02, i03, i04, i05, i06, i07, i08, i09;\n" + >+ " int i10, i11, i12, i13, i14, i15, i16, i17, i18, i19;\n" + >+ " int i20, i21, i22, i23, i24, i25, i26, i27, i28, i29;\n" + >+ " int i30, i31, i32, i33, i34, i35, i36, i37, i38, i39;\n" + >+ " int i40, i41, i42, i43, i44, i45, i46, i47, i48, i49;\n" + >+ " int i50, i51, i52, i53, i54, i55, i56, i57, i58, i59;\n" + >+ " int i60, i61, i62, i63, i64, i65, i66, i67, i68, i69;\n" + >+ >+ " String local1 = s1;\n" + >+ " String local2 = s2;\n" + >+ " \n" + >+ " String local3 = null;\n" + >+ " if (local1 != null && local2 != null)\n" + >+ " local3 = \"\"; //$NON-NLS-1$\n" + >+ " else\n" + >+ " local3 = local1 != null ? local1 : local2;\n" + >+ "\n" + >+ " if (local3 != null)\n" + >+ " return new Integer(local3.length());\n" + >+ " return null;\n" + >+ " }\n" + >+ " \n" + >+ " public static void main(String[] args) {\n" + >+ " System.out.print(foo(null, null));\n" + >+ " System.out.print(foo(\"p1\", null));\n" + >+ " System.out.print(foo(null, \"p2\"));\n" + >+ " System.out.print(foo(\"p1\", \"p2\"));\n" + >+ " }\n" + >+ "}"}, >+ "null220"); >+} > } >\ No newline at end of file
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:
amj87.iitr
:
iplog+
amj87.iitr
:
review+
Actions:
View
|
Diff
Attachments on
bug 325755
:
179259
|
179274
| 179283 |
179310