Fixed crash when trying to set variable id that cannot be found

This commit is contained in:
n00b87
2026-02-12 14:00:36 -06:00
parent e4d92c74b1
commit 72ecdc046e
2 changed files with 19 additions and 11 deletions

View File

@@ -6195,6 +6195,8 @@ bool check_rule()
} }
} }
else else
{
if(var_id_index >= 0 && var_id_index < id.size())
{ {
switch(var_type) switch(var_type)
{ {
@@ -6206,6 +6208,12 @@ bool check_rule()
break; break;
} }
} }
else
{
rc_setError("Identifier \"" + var_id + "\" could not be resolved");
return false;
}
}
} }
else if(rc_substr(token[0], 0, 4).compare("<id>")==0 && token.size() > 5) else if(rc_substr(token[0], 0, 4).compare("<id>")==0 && token.size() > 5)

View File

@@ -1,5 +1,5 @@
# depslib dependency file v1.0 # depslib dependency file v1.0
1769580634 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp 1770701118 source:/home/n00b/Projects/RCBASIC4/rcbasic_build/main.cpp
<iostream> <iostream>
<stack> <stack>
<vector> <vector>
@@ -37,7 +37,7 @@
1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/constants.h 1752004854 /home/n00b/Projects/RCBASIC4/rcbasic_build/constants.h
<vector> <vector>
1758412944 /home/n00b/Projects/RCBASIC4/rcbasic_build/parser.h 1770926352 /home/n00b/Projects/RCBASIC4/rcbasic_build/parser.h
"tokenizer.h" "tokenizer.h"
"identifier.h" "identifier.h"
"rc_global.h" "rc_global.h"