We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7a7c313 + 18bbf5f commit db4cc00Copy full SHA for db4cc00
compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
@@ -490,13 +490,13 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
490
assert(ArgsCstrBuff[ArgsCstrBuffLen - 1] == '\0');
491
auto Arg0 = std::string(ArgsCstrBuff);
492
buffer_offset = Arg0.size() + 1;
493
- auto ArgsCppStr =
494
- std::string(ArgsCstrBuff + buffer_offset, ArgsCstrBuffLen - 1);
+ auto ArgsCppStr = std::string(ArgsCstrBuff + buffer_offset,
+ ArgsCstrBuffLen - buffer_offset);
495
auto i = 0;
496
while (i != std::string::npos) {
497
i = ArgsCppStr.find('\0', i + 1);
498
if (i != std::string::npos)
499
- ArgsCppStr.replace(i, i + 1, " ");
+ ArgsCppStr.replace(i, 1, " ");
500
}
501
Options.MCOptions.Argv0 = Arg0;
502
Options.MCOptions.CommandlineArgs = ArgsCppStr;
0 commit comments