1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixed an NPE.

This commit is contained in:
Sergey Prigogin 2013-06-21 17:07:45 -07:00
parent 35a57ae158
commit 0cecd403cb

View file

@ -116,6 +116,8 @@ public final class CxxAstUtils {
public static boolean isInMacro(IASTNode node) {
IASTNodeSelector nodeSelector = node.getTranslationUnit().getNodeSelector(node.getTranslationUnit().getFilePath());
IASTFileLocation fileLocation = node.getFileLocation();
if (fileLocation == null)
return true;
IASTPreprocessorMacroExpansion macro = nodeSelector.findEnclosingMacroExpansion(fileLocation.getNodeOffset(),
fileLocation.getNodeLength());
return macro != null;