1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Fix for 154350

This commit is contained in:
David Daoust 2006-08-18 17:44:10 +00:00
parent 13fff05bbc
commit 1d508cd878

View file

@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.ui.editor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.EmptyStackException;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Stack; import java.util.Stack;
@ -504,13 +505,16 @@ public class CSourceViewerDecorationSupport
} }
} else if (statement instanceof IASTPreprocessorEndifStatement) { } else if (statement instanceof IASTPreprocessorEndifStatement) {
IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement; IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement;
boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue(); try {
if (inInactiveCode && !wasInInactiveCode) { boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue();
IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0]; if (inInactiveCode && !wasInInactiveCode) {
int inactiveCodeEnd = nodeLocation.getNodeOffset() + nodeLocation.getNodeLength(); IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0];
positions.add(new ReusableRegion(inactiveCodeStart, inactiveCodeEnd - inactiveCodeStart)); int inactiveCodeEnd = nodeLocation.getNodeOffset() + nodeLocation.getNodeLength();
positions.add(new ReusableRegion(inactiveCodeStart, inactiveCodeEnd - inactiveCodeStart));
}
inInactiveCode = wasInInactiveCode;
} }
inInactiveCode = wasInInactiveCode; catch( EmptyStackException e) {}
} }
} }
if (inInactiveCode) { if (inInactiveCode) {