Skip to content

Commit

Permalink
[WebAssembly] Fix a bug in MachineBasicBlock::findDebugLoc() call
Browse files Browse the repository at this point in the history
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

llvm-svn: 330079
  • Loading branch information
aheejin committed Apr 14, 2018
1 parent 95f421c commit 92401cc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
Expand Up @@ -147,9 +147,10 @@ static void PlaceBlockMarker(
}

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

// Mark the end of the block.
InsertPos = MBB.begin();
Expand Down

0 comments on commit 92401cc

Please sign in to comment.