Fix an assertion failure in slang RSSetObject generation
In clang::Stmt::CreateStructRSSetObject() an empty DeclarationNameInfo
was used to construct the source operand when constructing a call to
RSSetObject. This triggered an assertion failure on mismatching names
between FieldDecl and DeclarationNameInfo.
This fix passes a DeclarationNameInfo consistent with the FieldDecl's
name instead.
Bug: b/37363509
Bug: b/19545955
Test: slang tests, slang lit tests, RSTest and CTS on Angler all with
DISABLE_NDEBUG
Change-Id: I41dfba0f2a852fd48bcbdd4f8861da3d7aa8fd2a
diff --git a/slang_rs_object_ref_count.cpp b/slang_rs_object_ref_count.cpp
index 6740a1e..300b720 100644
--- a/slang_rs_object_ref_count.cpp
+++ b/slang_rs_object_ref_count.cpp
@@ -955,7 +955,9 @@
clang::SourceLocation(),
FD,
FoundDecl,
- clang::DeclarationNameInfo(),
+ clang::DeclarationNameInfo(
+ FD->getDeclName(),
+ clang::SourceLocation()),
nullptr,
OrigType->getCanonicalTypeInternal(),
clang::VK_RValue,