From b82faeb399ff55708f69c81c5a6a05b05cf2ca2f Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Tue, 6 Jul 2021 20:49:28 +0200 Subject: [PATCH] Substract 1 to the lexed vector's size in Parser.hpp to avoid getting out of bounds because of the next reference. --- src/headers/parsing/Parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index f25eda2..b61f657 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -7,7 +7,7 @@ namespace Parser { ParseTree parseVector(const vector& lexed) { ParseTree parseTree; using namespace StandardComponents::types; - for (unsigned int i = 0; i < lexed.size(); ++i) { + for (unsigned int i = 0; i < lexed.size() - 1; ++i) { const auto& current = lexed[i]; const auto& next = lexed[i + 1];