[HIPIFY] Add safe type check for cudaChooseDevice matcher.

Tá an tiomantas seo le fáil i:
Evgeny Mankov
2017-02-16 19:38:35 +03:00
tuismitheoir 806deeb476
tiomantas 93c1e31b36
+5 -1
Féach ar an gComhad
@@ -2344,7 +2344,11 @@ private:
SourceManager *SM = Result.SourceManager;
QualType QT = typeInfo->getType().getUnqualifiedType();
const Type *type = QT.getTypePtr();
StringRef name = type->getAsCXXRecordDecl()->getName();
CXXRecordDecl *rec = type->getAsCXXRecordDecl();
if (!rec) {
return false;
}
StringRef name = rec->getName();
const auto found = N.cuda2hipRename.find(name);
if (found != N.cuda2hipRename.end()) {
updateCounters(found->second, name.str());