mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Add cast_intrusive() and make use of it in two spots
This commit is contained in:
parent
c6f2e35af0
commit
6a1e4d61d1
3 changed files with 18 additions and 6 deletions
|
@ -2393,8 +2393,7 @@ IntrusivePtr<Val> AssignExpr::InitVal(const BroType* t, IntrusivePtr<Val> aggr)
|
|||
if ( aggr->Type()->Tag() != TYPE_TABLE )
|
||||
Internal("bad aggregate in AssignExpr::InitVal");
|
||||
|
||||
// TODO: implement safer IntrusivePtr casts
|
||||
IntrusivePtr<TableVal> tv{NewRef{}, aggr->AsTableVal()};
|
||||
auto tv = cast_intrusive<TableVal>(std::move(aggr));
|
||||
const TableType* tt = tv->Type()->AsTableType();
|
||||
const BroType* yt = tv->Type()->YieldType();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue