### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.133.4.2 diff -u -r1.133.4.2 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 23 Aug 2006 15:34:15 -0000 1.133.4.2 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 14 Sep 2006 00:44:11 -0000 @@ -200,18 +200,10 @@ } public void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) { // Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect - if ((this.generateAttributes & ClassFileConstants.ATTR_VARS) == 0) - return; -/* if (initStateIndex == lastInitStateIndexWhenAddingInits) + if (((this.generateAttributes & ClassFileConstants.ATTR_VARS) == 0) + && ((this.generateAttributes & ClassFileConstants.ATTR_STACK_MAP) == 0)) return; - lastInitStateIndexWhenAddingInits = initStateIndex; - if (lastInitStateIndexWhenRemovingInits != initStateIndex){ - lastInitStateIndexWhenRemovingInits = -2; // reinitialize remove index - // remove(1)-add(1)-remove(1) -> ignore second remove - // remove(1)-add(2)-remove(1) -> perform second remove - } - -*/ for (int i = 0; i < visibleLocalsCount; i++) { + for (int i = 0; i < visibleLocalsCount; i++) { LocalVariableBinding localBinding = visibleLocals[i]; if (localBinding != null) { // Check if the local is definitely assigned @@ -1039,7 +1031,7 @@ } // there may be some preserved locals never initialized - if (visibleLocal.initializationCount > 0 && ((this.generateAttributes & ClassFileConstants.ATTR_VARS) != 0)){ + if (visibleLocal.initializationCount > 0) { visibleLocal.recordInitializationEndPC(position); } visibleLocals[index--] = null; // this variable is no longer visible afterwards @@ -1047,7 +1039,6 @@ } public void exitUserScope(BlockScope currentScope, LocalVariableBinding binding) { // mark all the scope's locals as losing their definite assignment - if (((this.generateAttributes & ClassFileConstants.ATTR_VARS) == 0) && ((this.generateAttributes & ClassFileConstants.ATTR_STACK_MAP) == 0)) return; @@ -1060,7 +1051,7 @@ continue; } // there may be some preserved locals never initialized - if (visibleLocal.initializationCount > 0 && ((this.generateAttributes & ClassFileConstants.ATTR_VARS) != 0)){ + if (visibleLocal.initializationCount > 0) { visibleLocal.recordInitializationEndPC(position); } visibleLocals[index--] = null; // this variable is no longer visible afterwards @@ -5729,10 +5720,8 @@ System.arraycopy(locals, 0, locals = new LocalVariableBinding[allLocalsCounter + LOCALS_INCREMENT], 0, allLocalsCounter); } locals[allLocalsCounter++] = local; - if ((this.generateAttributes & ClassFileConstants.ATTR_VARS) != 0) { - local.initializationPCs = new int[4]; - local.initializationCount = 0; - } + local.initializationPCs = new int[4]; + local.initializationCount = 0; } public void recordExpressionType(TypeBinding typeBinding) { @@ -5850,7 +5839,8 @@ public void removeNotDefinitelyAssignedVariables(Scope scope, int initStateIndex) { // given some flow info, make sure we did not loose some variables initialization // if this happens, then we must update their pc entries to reflect it in debug attributes - if ((this.generateAttributes & ClassFileConstants.ATTR_VARS) == 0) + if (((this.generateAttributes & ClassFileConstants.ATTR_VARS) == 0) + && ((this.generateAttributes & ClassFileConstants.ATTR_STACK_MAP) == 0)) return; /* if (initStateIndex == lastInitStateIndexWhenRemovingInits) return; @@ -6303,7 +6293,8 @@ this.lastEntryPC = pos; } // need to update the initialization endPC in case of generation of local variable attributes. - if ((this.generateAttributes & ClassFileConstants.ATTR_VARS) != 0) { + if (((this.generateAttributes & ClassFileConstants.ATTR_VARS) != 0) + || ((this.generateAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0)) { for (int i = 0, max = this.locals.length; i < max; i++) { LocalVariableBinding local = this.locals[i]; if (local != null && local.declaringScope == scope && local.initializationCount > 0) { Index: compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java,v retrieving revision 1.4 diff -u -r1.4 BranchLabel.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 3 Apr 2006 13:51:37 -0000 1.4 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 14 Sep 2006 00:44:09 -0000 @@ -191,7 +191,8 @@ this.codeStream.pcToSourceMapSize-=2; } // end of new code - if ((this.codeStream.generateAttributes & ClassFileConstants.ATTR_VARS) != 0) { + if ((this.codeStream.generateAttributes & ClassFileConstants.ATTR_VARS) != 0 + || (this.codeStream.generateAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { LocalVariableBinding locals[] = this.codeStream.locals; for (int i = 0, max = locals.length; i < max; i++) { LocalVariableBinding local = locals[i];