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:
parent
35a57ae158
commit
0cecd403cb
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue