mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
GH-1122: Improve error for global record initialization exceptions
This commit is contained in:
parent
ff0aa6b050
commit
cf06ade325
4 changed files with 41 additions and 2 deletions
10
src/Var.cc
10
src/Var.cc
|
@ -252,7 +252,15 @@ static void make_var(const IDPtr& id, TypePtr t, InitClass c, ExprPtr init,
|
|||
|
||||
if ( t->Tag() == TYPE_RECORD )
|
||||
{
|
||||
aggr = make_intrusive<RecordVal>(cast_intrusive<RecordType>(t));
|
||||
try
|
||||
{
|
||||
aggr = make_intrusive<RecordVal>(cast_intrusive<RecordType>(t));
|
||||
}
|
||||
catch ( InterpreterException& )
|
||||
{
|
||||
id->Error("initialization failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( init && t )
|
||||
// Have an initialization and type is not deduced.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue