Multiple levels of pointers cannot be exported.
Change-Id: I533d26827fa650a481df65b2e20ac6dbc3559244
diff --git a/slang_rs_export_type.cpp b/slang_rs_export_type.cpp
index 4ab4af2..48d2288 100644
--- a/slang_rs_export_type.cpp
+++ b/slang_rs_export_type.cpp
@@ -260,8 +260,8 @@
}
case clang::Type::Pointer: {
if (TopLevelRecord) {
- ReportTypeError(DiagEngine, NULL, TopLevelRecord,
- "structures containing pointers cannot be exported: '%0'");
+ ReportTypeError(DiagEngine, VD, TopLevelRecord,
+ "structures containing pointers cannot be exported: '%0'");
return NULL;
}
@@ -269,8 +269,11 @@
UNSAFE_CAST_TYPE(const clang::PointerType, T);
const clang::Type *PointeeType = GET_POINTEE_TYPE(PT);
- if (PointeeType->getTypeClass() == clang::Type::Pointer)
- return T;
+ if (PointeeType->getTypeClass() == clang::Type::Pointer) {
+ ReportTypeError(DiagEngine, VD, TopLevelRecord,
+ "multiple levels of pointers cannot be exported: '%0'");
+ return NULL;
+ }
// We don't support pointer with array-type pointee or unsupported pointee
// type
if (PointeeType->isArrayType() ||