mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
ZAM fixes for "for" loops that are only used to choose an element from a table/set
This commit is contained in:
parent
d1dffd3e1b
commit
6660738b7d
3 changed files with 30 additions and 9 deletions
|
@ -214,6 +214,23 @@ ValPtr ZInst::ConstVal() const {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool ZInst::IsLoopIterationAdvancement() const {
|
||||
switch ( op ) {
|
||||
case OP_NEXT_TABLE_ITER_VV:
|
||||
case OP_NEXT_TABLE_ITER_NO_VARS_VV:
|
||||
case OP_NEXT_TABLE_ITER_VAL_VAR_VVV:
|
||||
case OP_NEXT_TABLE_ITER_VAL_VAR_NO_VARS_VVV:
|
||||
case OP_NEXT_VECTOR_ITER_VVV:
|
||||
case OP_NEXT_VECTOR_BLANK_ITER_VV:
|
||||
case OP_NEXT_VECTOR_ITER_VAL_VAR_VVVV:
|
||||
case OP_NEXT_VECTOR_BLANK_ITER_VAL_VAR_VVV:
|
||||
case OP_NEXT_STRING_ITER_VVV:
|
||||
case OP_NEXT_STRING_BLANK_ITER_VV: return true;
|
||||
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
string ZInst::ConstDump() const {
|
||||
auto v = ConstVal();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue