mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
track more information about temporary variables
This commit is contained in:
parent
64ef7f0eb2
commit
b581c6435e
2 changed files with 45 additions and 1 deletions
|
@ -11,7 +11,31 @@ TempVar::TempVar(int num, const TypePtr& t, ExprPtr _rhs) : type(t)
|
|||
char buf[8192];
|
||||
snprintf(buf, sizeof buf, "#%d", num);
|
||||
name = buf;
|
||||
id = nullptr;
|
||||
rhs = _rhs;
|
||||
}
|
||||
|
||||
void TempVar::SetAlias(IDPtr _alias, const DefPoints* _dps)
|
||||
{
|
||||
if ( alias )
|
||||
reporter->InternalError("Re-aliasing a temporary");
|
||||
|
||||
if ( ! _dps )
|
||||
{
|
||||
printf("trying to alias %s to %s\n", name.c_str(), _alias->Name());
|
||||
reporter->InternalError("Empty dps for alias");
|
||||
}
|
||||
|
||||
if ( alias == id )
|
||||
reporter->InternalError("Creating alias loop");
|
||||
|
||||
alias = _alias;
|
||||
dps = _dps;
|
||||
}
|
||||
|
||||
void TempVar::SetDPs(const DefPoints* _dps)
|
||||
{
|
||||
ASSERT(_dps->length() == 1);
|
||||
dps = _dps;
|
||||
}
|
||||
|
||||
} // zeek::detail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue