mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
factoring out logic to check for overflows during coercions
This commit is contained in:
parent
9757d37332
commit
a67897135e
8 changed files with 89 additions and 37 deletions
|
@ -1141,8 +1141,9 @@ eval frame[z.v1].double_val = double(frame[z.v2].uint_val);
|
|||
|
||||
|
||||
macro EvalCoerceVec(coercer)
|
||||
Unref(frame[z.v1].vector_val);
|
||||
auto old_v1 = frame[z.v1].vector_val;
|
||||
frame[z.v1].vector_val = coercer(frame[z.v2].vector_val);
|
||||
Unref(old_v1); // delayed to allow for same value on both sides
|
||||
|
||||
internal-op Coerce-UI-Vec
|
||||
type VV
|
||||
|
|
|
@ -98,7 +98,6 @@ static void vec_exec(ZOp op, TypePtr t, VectorVal*& v1, VectorVal* v2,
|
|||
auto res_zv = new VectorVal(yt); \
|
||||
auto n = v.size(); \
|
||||
res_zv->Resize(n); \
|
||||
ASSERT(0); \
|
||||
auto& res = *res_zv->RawVec(); \
|
||||
for ( auto i = 0U; i < n; ++i ) \
|
||||
if ( v[i] ) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue