1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52: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,6 +505,7 @@ public class CSourceViewerDecorationSupport
} }
} else if (statement instanceof IASTPreprocessorEndifStatement) { } else if (statement instanceof IASTPreprocessorEndifStatement) {
IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement; IASTPreprocessorEndifStatement endifStmt = (IASTPreprocessorEndifStatement)statement;
try {
boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue(); boolean wasInInactiveCode = ((Boolean)inactiveCodeStack.pop()).booleanValue();
if (inInactiveCode && !wasInInactiveCode) { if (inInactiveCode && !wasInInactiveCode) {
IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0]; IASTNodeLocation nodeLocation = endifStmt.getNodeLocations()[0];
@ -512,6 +514,8 @@ public class CSourceViewerDecorationSupport
} }
inInactiveCode = wasInInactiveCode; inInactiveCode = wasInInactiveCode;
} }
catch( EmptyStackException e) {}
}
} }
if (inInactiveCode) { if (inInactiveCode) {
// handle dangling #if? // handle dangling #if?