diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 313c02dc6f..962a59861f 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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. |