From b8c9b8e46815183fc8d295c3eb3cb441bca517d3 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 12 Sep 2024 09:31:39 +0300 Subject: [PATCH] ggml : add assert upon adding nodes --- ggml/src/ggml.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 0bdb71f70..47417c024 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -19202,6 +19202,7 @@ int ggml_graph_n_nodes(struct ggml_cgraph * cgraph) { } void ggml_graph_add_node(struct ggml_cgraph * cgraph, struct ggml_tensor * tensor) { + GGML_ASSERT(cgraph->size > cgraph->n_nodes); cgraph->nodes[cgraph->n_nodes] = tensor; cgraph->n_nodes++; }