mirror of
https://gitlab.com/niansa/pilang3.git
synced 2025-03-06 20:49:20 +01:00
Fixed crash in evaluator
This commit is contained in:
parent
0236ed50ab
commit
823ee09e94
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,7 @@ namespace Pilang3 {
|
||||||
bool newarg = false;
|
bool newarg = false;
|
||||||
bool escapenext = false;
|
bool escapenext = false;
|
||||||
std::string cache;
|
std::string cache;
|
||||||
for (auto characterit = expression.begin() + tspaces; characterit != expression.end(); characterit++) {
|
for (auto characterit = expression.begin() + tspaces; characterit < expression.end(); characterit++) {
|
||||||
char character = *characterit;
|
char character = *characterit;
|
||||||
// Start new command name
|
// Start new command name
|
||||||
if (in_command_name) {
|
if (in_command_name) {
|
||||||
|
@ -160,6 +160,9 @@ namespace Pilang3 {
|
||||||
thisfunc->evalChain.push_back(evaluation);
|
thisfunc->evalChain.push_back(evaluation);
|
||||||
// Skip over expression in iteration
|
// Skip over expression in iteration
|
||||||
character = *(characterit += evaluation->exprlen + 1);
|
character = *(characterit += evaluation->exprlen + 1);
|
||||||
|
if (characterit == expression.end()) {
|
||||||
|
throw exceptions::UnexpectedEndOfExpression();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
character = *(++characterit);
|
character = *(++characterit);
|
||||||
thisarg.data = thisfunc;
|
thisarg.data = thisfunc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue