]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
tests: export-graph-ops: exit gracefully when called w/o arguments (#25619)
authorChristian Kastner <redacted>
Tue, 14 Jul 2026 10:15:41 +0000 (12:15 +0200)
committerGitHub <redacted>
Tue, 14 Jul 2026 10:15:41 +0000 (13:15 +0300)
Fixes a segfault when `test-export-graph-ops` is called without any
arguments.

tests/test-export-graph-ops.cpp

index 7d8118dcd6860b52c1b42180b243a8aac6eb6a1c..46ded139850887657e0ce8aa7d933ad12d36ccc7 100644 (file)
@@ -152,6 +152,10 @@ int main(int argc, char ** argv) {
         init_result = common_init_from_params(params);
 
         ctx = init_result->context();
+        if (!ctx) {
+            LOG_ERR("failed to initialize params\n");
+            return 1;
+        }
     } else {
 #ifdef LLAMA_HF_FETCH
         auto [hf_repo, hf_quant] = common_download_split_repo_tag(params.model.hf_repo);