Add checks to avoid improper negative values use.

This commit is contained in:
Jon Siwek 2013-09-17 16:42:48 -05:00
parent a3b963ad4e
commit a316878d01
12 changed files with 89 additions and 62 deletions

View file

@ -895,6 +895,17 @@ public:
Val* Lookup(int field) const; // Does not Ref() value.
Val* LookupWithDefault(int field) const; // Does Ref() value.
/**
* Looks up the value of a field by field name. If the field doesn't
* exist in the record type, it's an internal error: abort.
* @param field name of field to lookup.
* @param with_default whether to rely on field's &default attribute when
* the field has yet to be initialized.
* @return the value in field \a field. It is Ref()'d only if
* \a with_default is true.
*/
Val* Lookup(const char* field, bool with_default = false) const;
void Describe(ODesc* d) const;
// This is an experiment to associate a BroObj within the