mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
ZAM fixes for record creation and table indexing potentially having side-effects
This commit is contained in:
parent
3addda28d3
commit
8f92e0d39b
4 changed files with 66 additions and 10 deletions
|
@ -736,6 +736,12 @@ const ZAMStmt ZAMCompiler::CompileIndex(const NameExpr* n1, int n2_slot, const T
|
|||
z = ZInstI(zop, Frame1Slot(n1, zop), n2_slot, c3);
|
||||
}
|
||||
|
||||
// See the discussion in CSE_ValidityChecker::PreExpr
|
||||
// regarding always needing to treat this as potentially
|
||||
// modifying globals.
|
||||
z.aux = new ZInstAux(0);
|
||||
z.aux->can_change_non_locals = true;
|
||||
|
||||
return AddInst(z);
|
||||
}
|
||||
}
|
||||
|
@ -1185,6 +1191,9 @@ const ZAMStmt ZAMCompiler::ConstructRecord(const NameExpr* n, const Expr* e)
|
|||
|
||||
z.t = e->GetType();
|
||||
|
||||
if ( ! rc->GetType<RecordType>()->IdempotentCreation() )
|
||||
z.aux->can_change_non_locals = true;
|
||||
|
||||
return AddInst(z);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue