Skip to content

Commit 05484c6

Browse files
authored
[mlir] Fix bug in PDLL Parser (#155243)
This reverts changes made to `mlir/lib/Tools/PDLL/Parser/Parser.cpp` in 095b41c . `raw_indented_ostream::printReindented()` reads from a string to which it also concurrently writes to, causing unintended behavior. Credits to @jackalcooper for finding the issue.
1 parent 7b467bc commit 05484c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mlir/lib/Tools/PDLL/Parser/Parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ class Parser {
147147
std::string docStr;
148148
{
149149
llvm::raw_string_ostream docOS(docStr);
150+
std::string tmpDocStr = doc.str();
150151
raw_indented_ostream(docOS).printReindented(
151-
StringRef(docStr).rtrim(" \t"));
152+
StringRef(tmpDocStr).rtrim(" \t"));
152153
}
153154
return docStr;
154155
}

0 commit comments

Comments
 (0)