[spirv] Stop translation if there are errors in previous stages (#632)

This commit is contained in:
Lei Zhang 2017-09-20 23:27:50 -04:00 коммит произвёл David Peixotto
Родитель 479f1cd9bf
Коммит 88cca461de
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -186,6 +186,10 @@ SPIRVEmitter::SPIRVEmitter(CompilerInstance &ci,
}
void SPIRVEmitter::HandleTranslationUnit(ASTContext &context) {
// Stop translating if there are errors in previous compilation stages.
if (context.getDiagnostics().hasErrorOccurred())
return;
AddRequiredCapabilitiesForShaderModel();
// Addressing and memory model are required in a valid SPIR-V module.