diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp --- a/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyDebugFixup.cpp @@ -118,7 +118,7 @@ // a $noreg DBG_VALUE for the variable to end it, right after // the current instruction. BuildMI(*Prev.DebugValue->getParent(), std::next(MII), - MI.getDebugLoc(), TII->get(WebAssembly::DBG_VALUE), false, + Prev.DebugValue->getDebugLoc(), TII->get(WebAssembly::DBG_VALUE), false, Register(), Prev.DebugValue->getOperand(2).getMetadata(), Prev.DebugValue->getOperand(3).getMetadata()); }