mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-24 00:40:14 +00:00
spvtest::Validate::CompileFailure: Don't leak the diagnostic (#2564)
This commit is contained in:
parent
b74d92a8c3
commit
d0a1f5a05a
@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "source/val/validation_state.h"
|
||||
#include "spirv-tools/libspirv.h"
|
||||
#include "test/test_fixture.h"
|
||||
#include "test/unit_spirv.h"
|
||||
|
||||
@ -113,6 +114,7 @@ std::string ValidateBase<T>::CompileFailure(std::string code,
|
||||
spvTextToBinary(ScopedContext(env).context, code.c_str(),
|
||||
code.size(), &binary_, &diagnostic));
|
||||
std::string result(diagnostic->error);
|
||||
spvDiagnosticDestroy(diagnostic);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user