fix: avoid writable mmap for read-only weights (#1698)

This commit is contained in:
leejet
2026-06-23 00:39:31 +08:00
committed by GitHub
parent 41f7acbfb0
commit f440ad9c29
6 changed files with 24 additions and 22 deletions

View File

@@ -261,15 +261,15 @@ bool parse_options(int argc, const char** argv, const std::vector<ArgOptions>& o
invalid_arg = true;
return;
}
if(option.concat && !option.target->empty()){
if(option.concat > 0 && option.concat <= 0xff){
if (option.concat && !option.target->empty()) {
if (option.concat > 0 && option.concat <= 0xff) {
*option.target += static_cast<char>(option.concat);
}
*option.target += argv_to_utf8(i, argv);
} else {
*option.target = argv_to_utf8(i, argv);
}
found_arg = true;
found_arg = true;
}))
break;