Switch RecordVal::CoerceTo() to use IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-18 17:52:54 -07:00
parent fcaade6e31
commit cda4738407
6 changed files with 39 additions and 28 deletions

View file

@ -42,7 +42,7 @@ function Files::__set_reassembly_buffer%(file_id: string, max: count%): bool
function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): bool
%{
using zeek::BifType::Record::Files::AnalyzerArgs;
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs.get());
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->AddAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag), rv.get());
return val_mgr->Bool(result);
@ -52,7 +52,7 @@ function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): b
function Files::__remove_analyzer%(file_id: string, tag: Files::Tag, args: any%): bool
%{
using zeek::BifType::Record::Files::AnalyzerArgs;
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs.get());
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->RemoveAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag) , rv.get());
return val_mgr->Bool(result);