From 10aeabf19dcad8385432c2936275b48addb8b653 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sun, 20 Nov 2022 00:29:52 +0300 Subject: Fix backtrace buffer head tracking --- emulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulator.cpp b/emulator.cpp index b7e884e..1446de5 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -51,7 +51,7 @@ struct Backtrace { static_assert(S > 0, "Backtrace size cannot be zero"); void Push(T value) { - head = (head < S) ? head + 1 : 0; + head = (head + 1) % S; buffer[head] = value; } void Normalize(void) -- cgit v1.2.3