diff options
| author | Arthur Eubanks <aeubanks@google.com> | 2024-10-16 21:26:34 +0000 | 
|---|---|---|
| committer | Arthur Eubanks <aeubanks@google.com> | 2024-10-16 21:26:34 +0000 | 
| commit | 6de277c03922fd67ad5d13daa9325357e7a02ac7 (patch) | |
| tree | 8fb162ba4a1099c7e4ed1b5f2bf467c5568bd3b2 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | bed75e7c21e8d18bd536a0f7c9e479d2f6707db3 (diff) | |
| download | rust-6de277c03922fd67ad5d13daa9325357e7a02ac7.tar.gz rust-6de277c03922fd67ad5d13daa9325357e7a02ac7.zip | |
rustc_llvm: Fix flattened CLI args
Fixes string manipulation errors introduced in #130446.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 8f0b1b81276..b28215af467 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -491,12 +491,12 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( auto Arg0 = std::string(ArgsCstrBuff); buffer_offset = Arg0.size() + 1; auto ArgsCppStr = - std::string(ArgsCstrBuff + buffer_offset, ArgsCstrBuffLen - 1); + std::string(ArgsCstrBuff + buffer_offset, ArgsCstrBuffLen - buffer_offset); auto i = 0; while (i != std::string::npos) { i = ArgsCppStr.find('\0', i + 1); if (i != std::string::npos) - ArgsCppStr.replace(i, i + 1, " "); + ArgsCppStr.replace(i, 1, " "); } Options.MCOptions.Argv0 = Arg0; Options.MCOptions.CommandlineArgs = ArgsCppStr; | 
