mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
use richer block-aware location information for ZAM instructions
This commit is contained in:
parent
9f9f01580f
commit
c8d15f1eaa
5 changed files with 65 additions and 27 deletions
|
@ -12,7 +12,8 @@
|
|||
|
||||
namespace zeek::detail {
|
||||
|
||||
StmtPtr curr_stmt;
|
||||
std::string curr_func;
|
||||
std::shared_ptr<ZAMLocInfo> curr_loc;
|
||||
TypePtr log_ID_enum_type;
|
||||
TypePtr any_base_type;
|
||||
bool ZAM_error = false;
|
||||
|
@ -77,8 +78,8 @@ void ZAM_run_time_error(const char* msg) {
|
|||
ZAM_error = true;
|
||||
}
|
||||
|
||||
void ZAM_run_time_error(std::shared_ptr<Location> loc, const char* msg) {
|
||||
reporter->RuntimeError(loc.get(), "%s", msg);
|
||||
void ZAM_run_time_error(std::shared_ptr<ZAMLocInfo> loc, const char* msg) {
|
||||
reporter->RuntimeError(loc->Loc(), "%s", msg);
|
||||
ZAM_error = true;
|
||||
}
|
||||
|
||||
|
@ -87,14 +88,14 @@ void ZAM_run_time_error(const char* msg, const Obj* o) {
|
|||
ZAM_error = true;
|
||||
}
|
||||
|
||||
void ZAM_run_time_error(std::shared_ptr<Location> loc, const char* msg, const Obj* o) {
|
||||
reporter->RuntimeError(loc.get(), "%s (%s)", msg, obj_desc(o).c_str());
|
||||
void ZAM_run_time_error(std::shared_ptr<ZAMLocInfo> loc, const char* msg, const Obj* o) {
|
||||
reporter->RuntimeError(loc->Loc(), "%s (%s)", msg, obj_desc(o).c_str());
|
||||
ZAM_error = true;
|
||||
}
|
||||
|
||||
void ZAM_run_time_warning(std::shared_ptr<Location> loc, const char* msg) {
|
||||
void ZAM_run_time_warning(std::shared_ptr<ZAMLocInfo> loc, const char* msg) {
|
||||
ODesc d;
|
||||
loc->Describe(&d);
|
||||
loc->Loc()->Describe(&d);
|
||||
|
||||
reporter->Warning("%s: %s", d.Description(), msg);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue