From 5ce12d7e24e0c9ad3508c01510f9b49cfe33d0f3 Mon Sep 17 00:00:00 2001 From: atimofee Date: Thu, 3 Mar 2016 19:36:52 +0300 Subject: [PATCH] Assert ("This function is used in places that assume strings use char") in stringLiteral::getString() FIXED [ROCm/hip commit: 3c0f30f21ca92356f319aa0e6938b9002494ac86] --- projects/hip/src/Cuda2Hip.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/hip/src/Cuda2Hip.cpp b/projects/hip/src/Cuda2Hip.cpp index 42d3ca836f..f27a1bc1e5 100644 --- a/projects/hip/src/Cuda2Hip.cpp +++ b/projects/hip/src/Cuda2Hip.cpp @@ -569,8 +569,10 @@ class Cuda2HipCallback : public MatchFinder::MatchCallback { if (const StringLiteral * stringLiteral = Result.Nodes.getNodeAs("stringLiteral")) { - StringRef s = stringLiteral->getString(); - processString(s, N, Replace, *SM, stringLiteral->getLocStart()); + if (stringLiteral->getCharByteWidth() == 1) { + StringRef s = stringLiteral->getString(); + processString(s, N, Replace, *SM, stringLiteral->getLocStart()); + } } if (const UnaryExprOrTypeTraitExpr * expr = Result.Nodes.getNodeAs("cudaStructSizeOf"))