From 1076c8db457370612232bbf70d8b186fb4ac36f6 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Sat, 14 Apr 2018 00:12:12 +0000 Subject: [PATCH] [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 --- lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index 3d9651c406d..12664e62a06 100644 --- a/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -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(); -- 2.11.0