Commit bca6b58e authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] fix memory leak in DeclareGeneric

Bug: v8:7824
Change-Id: Ifdf0fbe13b3c8229bc6d44cb6d68298b016fa071
Reviewed-on: https://chromium-review.googlesource.com/1090724Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53581}
parent db4b7e75
......@@ -322,7 +322,8 @@ Generic* Declarations::DeclareGeneric(const std::string& name, Module* module,
} else {
generic_list = GenericList::cast(previous);
}
Generic* result = new Generic(name, module, generic);
Generic* result = RegisterDeclarable(
std::unique_ptr<Generic>(new Generic(name, module, generic)));
generic_list->AddGeneric(result);
generic_declaration_scopes_[result] = GetScopeChainSnapshot();
return result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment