Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2006, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2006, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Stephan Herrmann <stephan@cs.tu-berlin.de> - [compiler] [null] Whitebox issues in null analysis, see https://bugs.eclipse.org/320170 |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.internal.compiler.flow; |
12 |
package org.eclipse.jdt.internal.compiler.flow; |
12 |
|
13 |
|
Lines 319-325
Link Here
|
319 |
// prot. non null |
320 |
// prot. non null |
320 |
& ((a2 = this.nullBit2) | (a4 = this.nullBit4)); |
321 |
& ((a2 = this.nullBit2) | (a4 = this.nullBit4)); |
321 |
// null or unknown |
322 |
// null or unknown |
322 |
m2 = s1 & (s2 = this.nullBit2) & (s3 ^ s4) |
323 |
m2 = s1 & (s2 = this.nullBit2) & (s3 ^ s4) // TODO(stephan): potential typo: should this be "s2 = source.nullBit2"??? |
323 |
// prot. null |
324 |
// prot. null |
324 |
& ((a3 = this.nullBit3) | a4); |
325 |
& ((a3 = this.nullBit3) | a4); |
325 |
// non null or unknown |
326 |
// non null or unknown |
Lines 336-341
Link Here
|
336 |
source.nullBit2 &= (nm1 = ~m1) & ((nm2 = ~m2) | a4); |
337 |
source.nullBit2 &= (nm1 = ~m1) & ((nm2 = ~m2) | a4); |
337 |
source.nullBit3 &= (nm1 | a2) & nm2; |
338 |
source.nullBit3 &= (nm1 | a2) & nm2; |
338 |
source.nullBit4 &= nm1 & nm2; |
339 |
source.nullBit4 &= nm1 & nm2; |
|
|
340 |
// any variable that is (pot n, pot nn, pot un) at end of try (as captured by *this* NullInfoRegistry) |
341 |
// has the same uncertainty also for the mitigated case (function result) |
342 |
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=320170 - [compiler] [null] Whitebox issues in null analysis |
343 |
// and org.eclipse.jdt.core.tests.compiler.regression.NullReferenceTest.test0536_try_finally() |
344 |
long x = ~this.nullBit1 & a2 & a3 & a4; // x is set for all variable ids that have state 0111 (pot n, pot nn, pot un) |
345 |
if (x != 0) { |
346 |
// restore state 0111 for all variable ids in x: |
347 |
source.nullBit1 &= ~x; |
348 |
source.nullBit2 |= x; |
349 |
source.nullBit3 |= x; |
350 |
source.nullBit4 |= x; |
351 |
} |
339 |
} |
352 |
} |
340 |
if (this.extra != null && source.extra != null) { |
353 |
if (this.extra != null && source.extra != null) { |
341 |
int length = this.extra[2].length, sourceLength = source.extra[0].length; |
354 |
int length = this.extra[2].length, sourceLength = source.extra[0].length; |