Fixed crash when trying to set variable id that cannot be found
This commit is contained in:
@@ -6195,15 +6195,23 @@ bool check_rule()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(var_type)
|
||||
{
|
||||
case ID_TYPE_NUM:
|
||||
vm_asm.push_back("mov !" + rc_intToString(id[var_id_index].vec_pos) + " " + expr_result);
|
||||
break;
|
||||
case ID_TYPE_STR:
|
||||
vm_asm.push_back("mov$ !" + rc_intToString(id[var_id_index].vec_pos) + " " + expr_result);
|
||||
break;
|
||||
{
|
||||
if(var_id_index >= 0 && var_id_index < id.size())
|
||||
{
|
||||
switch(var_type)
|
||||
{
|
||||
case ID_TYPE_NUM:
|
||||
vm_asm.push_back("mov !" + rc_intToString(id[var_id_index].vec_pos) + " " + expr_result);
|
||||
break;
|
||||
case ID_TYPE_STR:
|
||||
vm_asm.push_back("mov$ !" + rc_intToString(id[var_id_index].vec_pos) + " " + expr_result);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_setError("Identifier \"" + var_id + "\" could not be resolved");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user