import eclipse 3.1 M4 compiler
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / ast / DoStatement.java
index 0dc995d..a12254a 100644 (file)
@@ -59,11 +59,12 @@ public class DoStatement extends Statement {
 
                int previousMode = flowInfo.reachMode();
                                
+               FlowInfo actionInfo = flowInfo.copy().unconditionalInits().discardNullRelatedInitializations();
                if ((action != null) && !action.isEmptyBlock()) {
-                       flowInfo = action.analyseCode(currentScope, loopingContext, flowInfo);
+                       actionInfo = action.analyseCode(currentScope, loopingContext, actionInfo);
 
                        // code generation can be optimized when no need to continue in the loop
-                       if (!flowInfo.isReachable() && !loopingContext.initsOnContinue.isReachable()) {
+                       if (!actionInfo.isReachable() && !loopingContext.initsOnContinue.isReachable()) {
                                continueLabel = null;
                        }
                }
@@ -72,24 +73,24 @@ public class DoStatement extends Statement {
                 *   do { if (true) break; else blank = 0; } while(false);
                 *   blank = 1; // may be initialized already 
                 */
-               flowInfo.setReachMode(previousMode);
+               actionInfo.setReachMode(previousMode);
                
-               flowInfo =
+               actionInfo =
                        condition.analyseCode(
                                currentScope,
                                loopingContext,
                                (action == null
-                                       ? flowInfo
-                                       : (flowInfo.mergedWith(loopingContext.initsOnContinue))));
+                                       ? actionInfo
+                                       : (actionInfo.mergedWith(loopingContext.initsOnContinue))));
                if (!isConditionOptimizedFalse && continueLabel != null) {
-                       loopingContext.complainOnFinalAssignmentsInLoop(currentScope, flowInfo);
+                       loopingContext.complainOnDeferredChecks(currentScope, actionInfo);
                }
 
                // end of loop
                FlowInfo mergedInfo = FlowInfo.mergedOptimizedBranches(
                                loopingContext.initsOnBreak, 
                                isConditionOptimizedTrue, 
-                               flowInfo.initsWhenFalse(), 
+                               actionInfo.initsWhenFalse().addInitializationsFrom(flowInfo), // recover null inits from before condition analysis
                                false, // never consider opt false case for DO loop, since break can always occur (47776)
                                !isConditionTrue /*do{}while(true); unreachable(); */);
                mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);
@@ -155,7 +156,7 @@ public class DoStatement extends Statement {
        public void resolve(BlockScope scope) {
 
                TypeBinding type = condition.resolveTypeExpecting(scope, BooleanBinding);
-               condition.implicitWidening(type, type);
+               condition.computeConversion(scope, type, type);
                if (action != null)
                        action.resolve(scope);
        }