瀏覽代碼

kv-cache : fix use-after-move of defrag info (#14189)

ggml-ci
Georgi Gerganov 7 月之前
父節點
當前提交
5fce5f948d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/llama-kv-cache-unified.cpp

+ 1 - 1
src/llama-kv-cache-unified.cpp

@@ -1739,7 +1739,7 @@ llama_kv_cache_unified_state::llama_kv_cache_unified_state(
         llama_context * lctx,
         llama_context * lctx,
         bool do_shift,
         bool do_shift,
         defrag_info dinfo) : status(LLAMA_MEMORY_STATUS_SUCCESS), kv(kv), lctx(lctx), do_shift(do_shift), dinfo(std::move(dinfo)) {
         defrag_info dinfo) : status(LLAMA_MEMORY_STATUS_SUCCESS), kv(kv), lctx(lctx), do_shift(do_shift), dinfo(std::move(dinfo)) {
-    if (!do_shift && dinfo.empty()) {
+    if (!do_shift && this->dinfo.empty()) {
         status = LLAMA_MEMORY_STATUS_NO_UPDATE;
         status = LLAMA_MEMORY_STATUS_NO_UPDATE;
     }
     }
 }
 }