-O gen-C++ refinements for BiF failures, negative vector indices, boolean vector operations

This commit is contained in:
Vern Paxson 2023-06-15 11:08:14 -07:00
parent f64304067b
commit 18be4ba91b
9 changed files with 94 additions and 30 deletions

View file

@ -51,9 +51,13 @@ ValPtr index_table__CPP(const TableValPtr& t, vector<ValPtr> indices)
ValPtr index_vec__CPP(const VectorValPtr& vec, int index)
{
if ( index < 0 )
index += vec->Size();
auto v = vec->ValAt(index);
if ( ! v )
reporter->CPPRuntimeError("no such index");
return v;
}