mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Make CompHash computation/recovery for functions deterministic
Functions are now assigned a unique integer on construction which CompositeHash can base hashes on. Recovery then just involves looking up the function pointer associated with that unique number.
This commit is contained in:
parent
3ecd872291
commit
1cc675e30f
6 changed files with 64 additions and 27 deletions
13
src/Func.cc
13
src/Func.cc
|
@ -53,6 +53,19 @@ extern RETSIGTYPE sig_handler(int signo);
|
|||
const Expr* calling_expr = 0;
|
||||
bool did_builtin_init = false;
|
||||
|
||||
vector<Func*> Func::unique_ids;
|
||||
|
||||
Func::Func() : scope(0), id(0), return_value(0)
|
||||
{
|
||||
unique_id = unique_ids.size();
|
||||
unique_ids.push_back(this);
|
||||
}
|
||||
|
||||
Func::Func(Kind arg_kind) : scope(0), kind(arg_kind), id(0), return_value(0)
|
||||
{
|
||||
unique_id = unique_ids.size();
|
||||
unique_ids.push_back(this);
|
||||
}
|
||||
|
||||
Func::~Func()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue