Skip to content

Commit aa4d374

Browse files
authored
[SPIR-V] fix silent failure if disassembly fails (microsoft#6490)
When codegen is broken, and spirv-dis fails, DXC doesn't return any error, and simply displays nothing, and returns 0. Signed-off-by: Nathan Gauër <[email protected]>
1 parent 5e0bb14 commit aa4d374

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/clang/tools/dxclib/dxc.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,12 @@ int DxcContext::ActOnBlob(IDxcBlob *pBlob, IDxcBlob *pDebugBlob,
394394
clang::spirv::FeatureManager::stringToSpvEnvironment(
395395
m_Opts.SpirvOptions.targetEnv);
396396
IFTBOOLMSG(target_env, E_INVALIDARG, "Cannot parse SPIR-V target env.");
397-
398-
if (!DisassembleSpirv(pBlob, pLibrary, &pDisassembleResult,
399-
m_Opts.ColorCodeAssembly,
400-
m_Opts.DisassembleByteOffset, *target_env))
401-
return 1;
397+
IFTBOOLMSG(DisassembleSpirv(pBlob, pLibrary, &pDisassembleResult,
398+
m_Opts.ColorCodeAssembly,
399+
m_Opts.DisassembleByteOffset, *target_env),
400+
E_FAIL,
401+
"dxc failed : Internal Compiler Error - "
402+
"unable to disassemble generated SPIR-V.");
402403
} else {
403404
#endif // ENABLE_SPIRV_CODEGEN
404405
// SPIRV Change Ends

0 commit comments

Comments
 (0)