]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
arg: fix ASAN error on sampler_type_names empty (#18167)
authorXuan-Son Nguyen <redacted>
Thu, 18 Dec 2025 13:30:32 +0000 (14:30 +0100)
committerGitHub <redacted>
Thu, 18 Dec 2025 13:30:32 +0000 (14:30 +0100)
common/arg.cpp

index b6d16168ebc47f6324c95165643cb7605af87e3a..4a0ec656bddae3e3c3cf9c0708aa63b8af510b57 100644 (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_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
+    }
 
 
     /**