Merge remote-tracking branch 'origin/topic/jsiwek/enum-log-error-handling'

* origin/topic/jsiwek/enum-log-error-handling:
  Add more error handling code to logging of enum vals. (addresses #829)
This commit is contained in:
Robin Sommer 2012-06-11 15:59:00 -07:00
commit d1512ef462
3 changed files with 13 additions and 2 deletions

View file

@ -1,4 +1,9 @@
2.0-608 | 2012-06-11 15:59:00 -0700
* Add more error handling code to logging of enum vals. Addresses
#829. (Jon Siwek)
2.0-606 | 2012-06-11 15:55:56 -0700
* Fix summary lines for BIF documentation and corrected the

View file

@ -1 +1 @@
2.0-606
2.0-608

View file

@ -819,7 +819,13 @@ threading::Value* Manager::ValToLogVal(Val* val, BroType* ty)
const char* s =
val->Type()->AsEnumType()->Lookup(val->InternalInt());
lval->val.string_val = new string(s);
if ( s )
lval->val.string_val = new string(s);
else
{
val->Type()->Error("enum type does not contain value", val);
lval->val.string_val = new string();
}
break;
}