diff options
author | Oxore <oxore@protonmail.com> | 2022-11-20 00:29:52 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-11-20 01:24:48 +0300 |
commit | 10aeabf19dcad8385432c2936275b48addb8b653 (patch) | |
tree | 522eb34da4bc63718e0db30d601e018582d385d7 /emulator.cpp | |
parent | 24f5fa9973c13deab46317e240e1f4dfd1bb7f42 (diff) |
Fix backtrace buffer head tracking
Diffstat (limited to 'emulator.cpp')
-rw-r--r-- | emulator.cpp | 2 |
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) |