mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
bug fix for dealing with illegal types of initializers
This commit is contained in:
parent
e84b60762a
commit
e9a0a50da5
1 changed files with 5 additions and 0 deletions
|
@ -2537,6 +2537,11 @@ TypePtr init_type(const detail::ExprPtr& init) {
|
|||
if ( init->Tag() != detail::EXPR_LIST ) {
|
||||
auto t = init->InitType();
|
||||
|
||||
if ( ! t ) {
|
||||
init->Error("not a valid initializer");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if ( (t->Tag() == TYPE_TABLE && cast_intrusive<TableType>(t)->IsUnspecifiedTable()) ||
|
||||
(t->Tag() == TYPE_VECTOR && cast_intrusive<VectorType>(t)->IsUnspecifiedVector()) ) {
|
||||
init->Error("empty constructor in untyped initialization");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue