mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
remove non-functional column information from Location objects
This commit is contained in:
parent
5c63133226
commit
a9b37467a4
11 changed files with 15 additions and 32 deletions
|
@ -37,7 +37,7 @@ CPPStmt::CPPStmt(const char* _name, const char* filename, int line_num) : Stmt(S
|
|||
auto empty_args = make_intrusive<ListExpr>();
|
||||
|
||||
ce = make_intrusive<CallExpr>(make_intrusive<ConstExpr>(fv), empty_args);
|
||||
Location loc(filename, line_num, line_num, 1, 1);
|
||||
Location loc(filename, line_num, line_num);
|
||||
ce->SetLocationInfo(&loc);
|
||||
}
|
||||
|
||||
|
|
|
@ -498,8 +498,8 @@ void CPPCompile::GenAssertStmt(const AssertStmt* a) {
|
|||
Emit("auto msg_val = zeek::val_mgr->EmptyString();");
|
||||
|
||||
auto loc = a->GetLocationInfo();
|
||||
Emit("static Location loc(\"%s\", %s, %s, %s, %s);", loc->FileName(), std::to_string(loc->FirstLine()),
|
||||
std::to_string(loc->LastLine()), std::to_string(loc->FirstColumn()), std::to_string(loc->LastColumn()));
|
||||
Emit("static Location loc(\"%s\", %s, %s);", loc->FileName(), std::to_string(loc->FirstLine()),
|
||||
std::to_string(loc->LastLine()));
|
||||
Emit("report_assert(assert_result, \"%s\", msg_val, &loc);", CPPEscape(a->CondDesc().c_str()).c_str());
|
||||
EndBlock();
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ ZAMCompiler::ZAMCompiler(ScriptFuncPtr f, std::shared_ptr<ProfileFuncs> _pfs, st
|
|||
|
||||
auto loc = body->GetLocationInfo();
|
||||
ASSERT(loc->FirstLine() != 0 || body->Tag() == STMT_NULL);
|
||||
auto loc_copy = std::make_shared<Location>(loc->FileName(), loc->FirstLine(), loc->LastLine(), loc->FirstColumn(),
|
||||
loc->LastColumn());
|
||||
auto loc_copy = std::make_shared<Location>(loc->FileName(), loc->FirstLine(), loc->LastLine());
|
||||
ZAM::curr_func = func->GetName();
|
||||
ZAM::curr_loc = std::make_shared<ZAMLocInfo>(ZAM::curr_func, std::move(loc_copy), nullptr);
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@ namespace zeek::detail {
|
|||
const ZAMStmt ZAMCompiler::CompileStmt(const Stmt* s) {
|
||||
auto loc = s->GetLocationInfo();
|
||||
ASSERT(loc->FirstLine() != 0 || s->Tag() == STMT_NULL);
|
||||
auto loc_copy = std::make_shared<Location>(loc->FileName(), loc->FirstLine(), loc->LastLine(), loc->FirstColumn(),
|
||||
loc->LastColumn());
|
||||
auto loc_copy = std::make_shared<Location>(loc->FileName(), loc->FirstLine(), loc->LastLine());
|
||||
ASSERT(! AST_blocks || s->Tag() == STMT_NULL || AST_blocks->HaveExpDesc(loc_copy.get()));
|
||||
auto loc_parent = ZAM::curr_loc->Parent();
|
||||
ZAM::curr_loc = std::make_shared<ZAMLocInfo>(ZAM::curr_func, std::move(loc_copy), ZAM::curr_loc->Parent());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue