mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 10:36:06 +00:00
Fix undefined behavior: reference bound to dereferenced null pointer.
llvm-svn: 161899
This commit is contained in:
parent
a6e89aac91
commit
8a0527d54e
@ -167,8 +167,9 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag, diag::Mapping Map,
|
||||
(Map == diag::MAP_FATAL || Map == diag::MAP_ERROR)) &&
|
||||
"Cannot map errors into warnings!");
|
||||
assert(!DiagStatePoints.empty());
|
||||
assert((L.isInvalid() || SourceMgr) && "No SourceMgr for valid location");
|
||||
|
||||
FullSourceLoc Loc(L, *SourceMgr);
|
||||
FullSourceLoc Loc = SourceMgr? FullSourceLoc(L, *SourceMgr) : FullSourceLoc();
|
||||
FullSourceLoc LastStateChangePos = DiagStatePoints.back().Loc;
|
||||
// Don't allow a mapping to a warning override an error/fatal mapping.
|
||||
if (Map == diag::MAP_WARNING) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user