mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Fix uncaught exceptions from Val cloning failures
This commit is contained in:
parent
418ab0e33a
commit
e5e84041b7
1 changed files with 14 additions and 1 deletions
15
src/Val.cc
15
src/Val.cc
|
@ -1747,7 +1747,20 @@ Val* TableVal::Default(Val* index)
|
|||
|
||||
if ( def_val->Type()->Tag() != TYPE_FUNC ||
|
||||
same_type(def_val->Type(), Type()->YieldType()) )
|
||||
return def_attr->AttrExpr()->IsConst() ? def_val->Ref() : def_val->Clone();
|
||||
{
|
||||
if ( def_attr->AttrExpr()->IsConst() )
|
||||
return def_val->Ref();
|
||||
|
||||
try
|
||||
{
|
||||
return def_val->Clone();
|
||||
}
|
||||
catch ( InterpreterException& e )
|
||||
{ /* Already reported. */ }
|
||||
|
||||
Error("&default value for table is not clone-able");
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Func* f = def_val->AsFunc();
|
||||
val_list vl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue