summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2022-11-20 00:29:52 +0300
committerOxore <oxore@protonmail.com>2022-11-20 01:24:48 +0300
commit10aeabf19dcad8385432c2936275b48addb8b653 (patch)
tree522eb34da4bc63718e0db30d601e018582d385d7
parent24f5fa9973c13deab46317e240e1f4dfd1bb7f42 (diff)
Fix backtrace buffer head tracking
-rw-r--r--emulator.cpp2
1 files changed, 1 insertions, 1 deletions
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)