diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp index 7ed224d..4a0738d 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -239,8 +239,10 @@ bool WebAssemblyExplicitLocals::runOnMachineFunction(MachineFunction &MF) { Changed = true; } - // Start assigning local numbers after the last parameter. + // Start assigning local numbers after the last parameter and after any + // already-assigned locals. unsigned CurLocal = static_cast<unsigned>(MFI.getParams().size()); + CurLocal += static_cast<unsigned>(MFI.getLocals().size()); // Precompute the set of registers that are unused, so that we can insert // drops to their defs. |