[llvm] [llvm-ml] Remove unsafe getCurrentSegmentOnly() call (PR #123355)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 07:29:52 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mc

Author: Eric Astor (ericastor)

<details>
<summary>Changes</summary>

This call was made unsafe recently, but was not fixed in db48f1a1764023f8efeb055e343b967d1eb37d19 (the commit that fixed the parallel code in AsmParser.cpp).

---
Full diff: https://github.com/llvm/llvm-project/pull/123355.diff


1 Files Affected:

- (modified) llvm/lib/MC/MCParser/MasmParser.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/MC/MCParser/MasmParser.cpp b/llvm/lib/MC/MCParser/MasmParser.cpp
index 78261c1f9fedb2..6c49a17180f27b 100644
--- a/llvm/lib/MC/MCParser/MasmParser.cpp
+++ b/llvm/lib/MC/MCParser/MasmParser.cpp
@@ -1454,7 +1454,7 @@ bool MasmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
 }
 
 bool MasmParser::checkForValidSection() {
-  if (!ParsingMSInlineAsm && !getStreamer().getCurrentSectionOnly()) {
+  if (!ParsingMSInlineAsm && !getStreamer().getCurrentFragment()) {
     Out.initSections(false, getTargetParser().getSTI());
     return Error(getTok().getLoc(),
                  "expected section directive before assembly directive");

``````````

</details>


https://github.com/llvm/llvm-project/pull/123355


More information about the llvm-commits mailing list