Skip to content

Commit 4d1316c

Browse files
authored
arg: fix ASAN error on sampler_type_names empty (#18167)
1 parent ec7b932 commit 4d1316c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/arg.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,9 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
873873
sampler_type_chars += common_sampler_type_to_chr(sampler);
874874
sampler_type_names += common_sampler_type_to_str(sampler) + ";";
875875
}
876-
sampler_type_names.pop_back();
876+
if (!sampler_type_names.empty()) {
877+
sampler_type_names.pop_back(); // remove last semicolon
878+
}
877879

878880

879881
/**

0 commit comments

Comments
 (0)