mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
fix for deprecated when's where the inner frame is larger than the outer frame
This commit is contained in:
parent
19ba30d77a
commit
71d1022269
3 changed files with 20 additions and 1 deletions
14
src/Scope.cc
14
src/Scope.cc
|
@ -190,6 +190,20 @@ ScopePtr pop_scope()
|
|||
return old_top;
|
||||
}
|
||||
|
||||
void merge_top_scope()
|
||||
{
|
||||
if ( scopes.size() < 2 )
|
||||
reporter->InternalError("scope merge underflow");
|
||||
|
||||
auto t = pop_scope();
|
||||
|
||||
for ( auto v : t->OrderedVars() )
|
||||
{
|
||||
v->SetOffset(top_scope->Length());
|
||||
top_scope->Insert(v->Name(), v);
|
||||
}
|
||||
}
|
||||
|
||||
ScopePtr current_scope()
|
||||
{
|
||||
return top_scope;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue