aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-15 05:34:52 +0630
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-15 05:34:52 +0630
commite22ed450ac2f86787f455f529d6ad1a2ccb33260 (patch)
tree066a918f85850be31125f6e0ff8be683f2ea780f
parent940dd2021e2e82b067b7646ca257ec7d52729021 (diff)
downloadovm-e22ed450ac2f86787f455f529d6ad1a2ccb33260.tar.gz
ovm-e22ed450ac2f86787f455f529d6ad1a2ccb33260.tar.bz2
ovm-e22ed450ac2f86787f455f529d6ad1a2ccb33260.zip
Fix some off by one errors
-rw-r--r--asm/preprocesser.cpp4
1 files 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<token_t *> &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<token_t *> 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};