mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-25 09:20:30 +01:00
microsoft/clc: Fix test double free in the case of compilation failure
Reviewed-by: Bill Kristiansen <billkris@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17246>
This commit is contained in:
parent
d69e258e8e
commit
fd37959680
1 changed files with 4 additions and 3 deletions
|
|
@ -848,13 +848,14 @@ ComputeTest::configure(Shader &shader,
|
|||
throw runtime_error("failed to parse spirv!");
|
||||
}
|
||||
|
||||
shader.dxil = std::shared_ptr<clc_dxil_object>(new clc_dxil_object{}, [](clc_dxil_object *dxil)
|
||||
std::unique_ptr<clc_dxil_object> dxil(new clc_dxil_object{});
|
||||
if (!clc_spirv_to_dxil(compiler_ctx, shader.obj.get(), shader.metadata.get(), "main_test", conf, nullptr, &logger, dxil.get()))
|
||||
throw runtime_error("failed to compile kernel!");
|
||||
shader.dxil = std::shared_ptr<clc_dxil_object>(dxil.release(), [](clc_dxil_object *dxil)
|
||||
{
|
||||
clc_free_dxil_object(dxil);
|
||||
delete dxil;
|
||||
});
|
||||
if (!clc_spirv_to_dxil(compiler_ctx, shader.obj.get(), shader.metadata.get(), "main_test", conf, nullptr, &logger, shader.dxil.get()))
|
||||
throw runtime_error("failed to compile kernel!");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue