diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 313c02dc6fd..962a59861f3 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -50,8 +50,10 @@ CGDebugInfo::~CGDebugInfo() { } void CGDebugInfo::setLocation(SourceLocation Loc) { - if (Loc.isValid()) - CurLoc = CGM.getContext().getSourceManager().getExpansionLoc(Loc); + // If the new location isn't valid return. + if (!Loc.isValid()) return; + + CurLoc = CGM.getContext().getSourceManager().getExpansionLoc(Loc); } /// getContextDescriptor - Get context info for the decl. |