mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
Check for integral slice indexes, add extra test for [:]
This commit is contained in:
parent
f1383d98c2
commit
964e2c91a3
3 changed files with 4 additions and 0 deletions
|
@ -484,6 +484,8 @@ expr:
|
|||
set_location(@1, @6);
|
||||
Expr* low = $3 ? $3 : new ConstExpr(val_mgr->GetCount(0));
|
||||
Expr* high = $5 ? $5 : new SizeExpr($1);
|
||||
if ( ! IsIntegral(low->Type()->Tag()) || ! IsIntegral(high->Type()->Tag()) )
|
||||
reporter->FatalError("slice notation must have integral values as indexes");
|
||||
ListExpr* le = new ListExpr(low);
|
||||
le->Append(high);
|
||||
$$ = new IndexExpr($1, le, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue