From e22ed450ac2f86787f455f529d6ad1a2ccb33260 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 15 Apr 2024 05:34:52 +0630 Subject: Fix some off by one errors --- asm/preprocesser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm/preprocesser.cpp b/asm/preprocesser.cpp index 027212a..1245ff7 100644 --- a/asm/preprocesser.cpp +++ b/asm/preprocesser.cpp @@ -83,7 +83,7 @@ preprocess_use_blocks(const vector &tokens) new_tokens.insert(new_tokens.end(), ftokens.begin(), ftokens.end()); - i += 2; + ++i; } else new_tokens.push_back(new token_t{*t}); @@ -128,7 +128,7 @@ preprocess_const_blocks(vector const &tokens) if (i == tokens.size()) return ERR(pp_err_t{pp_err_type_t::EXPECTED_END}); - block_end = i - 1; + block_end = i; blocks[capture.substr(start + 1, end - 1)] = const_t{block_start, block_end}; -- cgit v1.2.3-13-gbd6f