Commit 9f26fe11c for llama.cpp
commit 9f26fe11c73c7e74a5e99e7f1b6370ad8e1cb22d
Author: IsNot <209144869@qq.com>
Date: Sun Nov 15 07:32:37 2026 +0800
common : reject out-of-range grammar_triggers type instead of aborting (#30835) (#31478)
* common : reject out-of-range grammar_triggers type instead of aborting (#30835)
* tests : remove the invalid grammar trigger type regression test (#30835)
diff --git a/common/sampling.cpp b/common/sampling.cpp
index 564fa9c4d..0fe1c7405 100644
--- a/common/sampling.cpp
+++ b/common/sampling.cpp
@@ -255,7 +255,8 @@ struct common_sampler * common_sampler_init(
break;
}
default:
- GGML_ASSERT(false && "unknown trigger type");
+ throw std::runtime_error(
+ "unknown grammar trigger type: " + std::to_string(trigger.type));
}
}