mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
Fix use-after-move bug in Scope constructor
This commit is contained in:
parent
06bac61607
commit
9eaa2cb45b
1 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ Scope::Scope(IDPtr id, std::unique_ptr<std::vector<AttrPtr>> al)
|
|||
{
|
||||
return_type = nullptr;
|
||||
|
||||
if ( id )
|
||||
if ( scope_id )
|
||||
{
|
||||
const auto& id_type = scope_id->GetType();
|
||||
|
||||
|
@ -31,7 +31,7 @@ Scope::Scope(IDPtr id, std::unique_ptr<std::vector<AttrPtr>> al)
|
|||
else if ( id_type->Tag() != TYPE_FUNC )
|
||||
reporter->InternalError("bad scope id");
|
||||
|
||||
FuncType* ft = id->GetType()->AsFuncType();
|
||||
FuncType* ft = scope_id->GetType()->AsFuncType();
|
||||
return_type = ft->Yield();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue