From 2b70583997bbacd39702f98bbb1c355c02382383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Thu, 24 Sep 2026 08:40:06 +0200 Subject: [PATCH] server,common : fix the GCC 12 stringop-overread false positive (again) (#29325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- common/speculative.cpp | 4 +--- tools/server/server-context.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/speculative.cpp b/common/speculative.cpp index 77dfe9535f..6fdfa4dc33 100644 --- a/common/speculative.cpp +++ b/common/speculative.cpp @@ -228,9 +228,7 @@ struct common_speculative_impl_draft_simple : public common_speculative_impl { common_params_sampling params; params.no_perf = false; params.top_k = 10; - params.samplers = { - COMMON_SAMPLER_TYPE_TOP_K, - }; + params.samplers.assign(1, COMMON_SAMPLER_TYPE_TOP_K); smpl.reset(common_sampler_init(llama_get_model(ctx_dft), params)); } diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cpp index 274af9b05b..e95fb63ab3 100644 --- a/tools/server/server-context.cpp +++ b/tools/server/server-context.cpp @@ -2060,7 +2060,7 @@ private: res->is_begin = true; } else { res->content = tkn.text_to_send; - res->tokens = { tkn.tok }; + res->tokens.assign(1, tkn.tok); } res->n_decoded = slot.stats.n_gen;