Skip to content

Commit 50264ff

Browse files
payneclRiver707
authored andcommitted
Adding missing filter check to SourceMgrDiagnosticHandler::EmitDiagnostics
There is a case in EmitDiagnostics where the filter check is bypassed (when locationStack is empty). Filter might also be bypassed when loc instead of showableLoc is added to the locationStack. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D106522
1 parent ca2e053 commit 50264ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/IR/Diagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void SourceMgrDiagnosticHandler::emitDiagnostic(Diagnostic &diag) {
466466
SmallVector<std::pair<Location, StringRef>> locationStack;
467467
auto addLocToStack = [&](Location loc, StringRef locContext) {
468468
if (Optional<Location> showableLoc = findLocToShow(loc))
469-
locationStack.emplace_back(loc, locContext);
469+
locationStack.emplace_back(*showableLoc, locContext);
470470
};
471471

472472
// Add locations to display for this diagnostic.

0 commit comments

Comments
 (0)