Fix allocator mismatch with CompileWithDebug output string (#2137)

We declare CHeapPtr<wchar_t> DebugBlobName;, where CHeapPtr uses the CCRTAllocator by default, but initialize it with: Unicode::UTF8BufferToUTF16ComHeap(pDebugName, &DebugBlobName), which uses CComHeapPtr<wchar_t> p;

If we don't hit any exceptions, things are fine because we end up doing: *ppDebugBlobName = DebugBlobName.Detach(); , so the destructor will be a no-op.
This commit is contained in:
Tristan Labelle 2019-04-23 08:07:49 -07:00 коммит произвёл GitHub
Родитель 91f37618db
Коммит 93035fd2a5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -342,7 +342,7 @@ public:
HRESULT hr = S_OK;
CComPtr<IDxcBlobEncoding> utf8Source;
CComPtr<AbstractMemoryStream> pOutputStream;
CHeapPtr<wchar_t> DebugBlobName;
CComHeapPtr<wchar_t> DebugBlobName;
DxcEtw_DXCompilerCompile_Start();
pSourceName = (pSourceName && *pSourceName) ? pSourceName : L"hlsl.hlsl"; // declared optional, so pick a default