Allow passing a location to BroObj::Warning and BroObj::Error.

This allows callers (such as check_and_promote) to pass an expression location to be logged if the location doesn't exist in the value being promoted.
This commit is contained in:
Tim Wojtulewicz 2019-05-30 15:36:30 -07:00
parent 8ca2cff13f
commit 2d61ea5cd6
4 changed files with 16 additions and 14 deletions

View file

@ -118,9 +118,9 @@ public:
// included in the message, though if pinpoint_only is non-zero,
// then obj2 is only used to pinpoint the location.
void Warn(const char* msg, const BroObj* obj2 = 0,
int pinpoint_only = 0) const;
int pinpoint_only = 0, const Location* expr_location = 0) const;
void Error(const char* msg, const BroObj* obj2 = 0,
int pinpoint_only = 0) const;
int pinpoint_only = 0, const Location* expr_location = 0) const;
// Report internal errors.
void BadTag(const char* msg, const char* t1 = 0,
@ -178,7 +178,7 @@ private:
friend class SuppressErrors;
void DoMsg(ODesc* d, const char s1[], const BroObj* obj2 = 0,
int pinpoint_only = 0) const;
int pinpoint_only = 0, const Location* expr_location = 0) const;
void PinPoint(ODesc* d, const BroObj* obj2 = 0,
int pinpoint_only = 0) const;