Skip to content

Commit 1076c8d

Browse files
committed
[WebAssembly] Fix a bug in MachineBasicBlock::findDebugLoc() call
Summary: InsertPos is within the bacic block `Header`, so `findDebugLoc()` should be called on not `MBB` but `Header` instead. Reviewers: yurydelendik Subscribers: jfb, dschuff, aprantl, sbc100, jgravelle-google, sunfish, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D45648 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330079 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c4082cf commit 1076c8d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ static void PlaceBlockMarker(
147147
}
148148

149149
// Add the BLOCK.
150-
MachineInstr *Begin = BuildMI(*Header, InsertPos, MBB.findDebugLoc(InsertPos),
151-
TII.get(WebAssembly::BLOCK))
152-
.addImm(int64_t(WebAssembly::ExprType::Void));
150+
MachineInstr *Begin =
151+
BuildMI(*Header, InsertPos, Header->findDebugLoc(InsertPos),
152+
TII.get(WebAssembly::BLOCK))
153+
.addImm(int64_t(WebAssembly::ExprType::Void));
153154

154155
// Mark the end of the block.
155156
InsertPos = MBB.begin();

0 commit comments

Comments
 (0)