arg: fix ASAN error on sampler_type_names empty (#18167)

This commit is contained in:
Xuan-Son Nguyen 2025-12-18 14:30:32 +01:00 committed by GitHub
parent ec7b9329ae
commit 4d1316c440
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -873,7 +873,9 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
sampler_type_chars += common_sampler_type_to_chr(sampler); sampler_type_chars += common_sampler_type_to_chr(sampler);
sampler_type_names += common_sampler_type_to_str(sampler) + ";"; sampler_type_names += common_sampler_type_to_str(sampler) + ";";
} }
sampler_type_names.pop_back(); if (!sampler_type_names.empty()) {
sampler_type_names.pop_back(); // remove last semicolon
}
/** /**