mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
BIT-1288: Improve coercion of &default expressions.
This commit is contained in:
parent
08d843c258
commit
f214158cc5
5 changed files with 50 additions and 1 deletions
|
@ -45,6 +45,13 @@ public:
|
|||
attr_tag Tag() const { return tag; }
|
||||
Expr* AttrExpr() const { return expr; }
|
||||
|
||||
// Up to the caller to decide if previous expr can be unref'd since it may
|
||||
// not always be safe. e.g. expressions (at time of writing) don't always
|
||||
// keep careful track of referencing their operands, so doing something
|
||||
// like SetAttrExpr(coerce(AttrExpr())) must not completely unref the
|
||||
// previous expr as the new expr depends on it.
|
||||
void SetAttrExpr(Expr* e) { expr = e; }
|
||||
|
||||
int RedundantAttrOkay() const
|
||||
{ return tag == ATTR_REDEF || tag == ATTR_OPTIONAL; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue