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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 20:59:28 PST 2025


================
@@ -441,6 +441,10 @@ bool COFFMasmParser::parseDirectiveOption(StringRef Directive, SMLoc Loc) {
 ///          statements
 ///      label "endproc"
 bool COFFMasmParser::parseDirectiveProc(StringRef Directive, SMLoc Loc) {
+  if (!getStreamer().getCurrentFragment()) {
+    return Error(getTok().getLoc(), "expected section directive");
----------------
MaskRay wrote:

omit braces for the single line simple statement

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


More information about the llvm-commits mailing list