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

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


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

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

>From e8b956df20b850985f8a55d0a3408d632a35f92d Mon Sep 17 00:00:00 2001
From: Eric Astor <epastor at google.com>
Date: Fri, 17 Jan 2025 15:27:52 +0000
Subject: [PATCH] [llvm-ml] Remove unsafe getCurrentSegmentOnly() call

---
 llvm/lib/MC/MCParser/MasmParser.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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");



More information about the llvm-commits mailing list