mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
-O gen-C++ refinements for BiF failures, negative vector indices, boolean vector operations
This commit is contained in:
parent
f64304067b
commit
18be4ba91b
9 changed files with 94 additions and 30 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue