diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-03-25 21:12:34 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-03-25 21:12:34 +0330 |
commit | 20fea9f540b996bf0efa8ecaf390f12a3c7254c3 (patch) | |
tree | 5deee720e0853877a270b816ea23b2fae759f9c6 /src | |
parent | 3bd7d3498f12cfb8dbdf5fff7c0bc981bf8085e2 (diff) |
fix recursive call bug
Diffstat (limited to 'src')
-rw-r--r-- | src/runner/runner.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runner/runner.c b/src/runner/runner.c index d77e2b8..28270ea 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -77,7 +77,7 @@ void runnerVariableSetValue(RunnerVariablePages *pages, "Can't assign to const"); exit(1); } - for (size_t i = 0; i < pages->size; ++i) { + for (size_t i = pages->size - 1; i != (size_t)-1ULL; --i) { RunnerVariables *variables = pages->data[i]; for (size_t j = 0; j < variables->size; ++j) { RunnerVariable *var = variables->data[j]; @@ -100,7 +100,7 @@ AstTree *runnerVariableGetValue(RunnerVariablePages *pages, if (variable->isConst) { return variable->value; } - for (size_t i = 0; i < pages->size; ++i) { + for (size_t i = pages->size - 1; i != (size_t)-1ULL; --i) { RunnerVariables *variables = pages->data[i]; for (size_t j = 0; j < variables->size; ++j) { RunnerVariable *var = variables->data[j]; |