From a3c75126e04737f7e853435303aae3bd19f4e539 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Wed, 25 Jan 2023 15:39:14 +0100
Subject: [PATCH] Fix IndexError in TopLevelParse

---
 gdb-port/top-level-parse.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py
index 6b3fa38..d2f97b9 100644
--- a/gdb-port/top-level-parse.py
+++ b/gdb-port/top-level-parse.py
@@ -90,7 +90,7 @@ class TopLevelParse:
 			newbytes = parse_state['arena']['arena_malloc_bytes']
 			self.cumulative_byte_differences.insert(0, newbytes - self.bytes_at_enter[-(len(self.cumulative_byte_differences)+1)]) # TODO: consistency. this is the third way of answering the question, "how deep are we in the stack"
 			allocated_bytes = self.cumulative_byte_differences[-len(self.cumulative_byte_differences)] - self.cumulative_byte_differences[-(len(self.cumulative_byte_differences)-1)]  # NB: len(self.cumulative_byte_differences) changed since the last line
-			self.total_byte_differences[-len(self.cumulative_byte_differences)] = allocated_bytes
+			self.total_byte_differences.insert(-len(self.cumulative_byte_differences), allocated_bytes)
 			parser_obj.add_mem_use(allocated_bytes)
 			# TODO: allocations can be attributed to individual h_do_parse(parser) calls, thus the same per-parser per-arena stats tracking can be done
 
-- 
GitLab