change instruction dispatch to computed-goto

bug fixed
prepare for version 7.0
This commit is contained in:
ValKmjolnir
2021-06-26 14:53:10 +08:00
parent 3c9a10d710
commit 706659ba3d
7 changed files with 212 additions and 194 deletions
+1 -1
View File
@@ -722,7 +722,7 @@ nasal_val* builtin_substr(std::vector<nasal_val*>& local_scope,nasal_gc& gc)
std::string& str=*str_addr->ptr.str;
int beg=(int)beg_addr->ptr.num;
int len=(int)len_addr->ptr.num;
if(beg>=str.length() || beg+len>=str.length())
if(beg>=str.length() || beg+len-1>=str.length())
{
builtin_err("susbtr","index out of range");
return nullptr;