From f466cfa38fac99e80a2aa4b58b3203b33872fe9c Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 20 Aug 2026 10:00:16 +0300 Subject: [PATCH] spec : avoid binding reference to null pointer (#27404) --- common/speculative.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/speculative.cpp b/common/speculative.cpp index ae55e357d..89e9b2782 100644 --- a/common/speculative.cpp +++ b/common/speculative.cpp @@ -2649,6 +2649,10 @@ void common_speculative_draft(common_speculative * spec) { for (llama_seq_id seq_id = 0; seq_id < (llama_seq_id) dparams.size(); ++seq_id) { auto & dp = dparams[seq_id]; + if (!dp.drafting) { + continue; + } + auto & result = *dp.result; // a new draft has been sampled