mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Tame error reporting and abort() for undefined types
The script added as a test case reports the following messages *and* dumps a core file. Printing the first error and a normal failure exit seems sufficient. IMO triggering an abort() due to user scripting issues is not something that Zeek should do $ zeek ./identifier-not-defined-error.zeek error in ./identifier-not-defined-error.zeek, line 10: identifier not defined: MyEnu error in ./identifier-not-defined-error.zeek, line 10 and error: &default value has inconsistent type (M::MY_ENUM_A and error) internal error in ./identifier-not-defined-error.zeek, line 11: type inconsistency in ZVal constructor Aborted (core dumped) Change is to skip certain checks when an error type is propagated.
This commit is contained in:
parent
9a96e3b52a
commit
25ee288a76
4 changed files with 20 additions and 3 deletions
|
@ -243,8 +243,9 @@ void Attributes::AddAttr(AttrPtr attr, bool is_redef)
|
|||
// We only check the attribute after we've added it, to facilitate
|
||||
// generating error messages via Attributes::Describe. If the
|
||||
// instantiator of the object specified a null type, however, then
|
||||
// that's a signal to skip the checking.
|
||||
if ( type )
|
||||
// that's a signal to skip the checking. If the type is error,
|
||||
// there's no point checking attributes either.
|
||||
if ( type && ! IsErrorType(type->Tag()) )
|
||||
CheckAttr(attr.get());
|
||||
|
||||
// For ADD_FUNC or DEL_FUNC, add in an implicit REDEF, since
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue