Revert "Remove string literal checks."
This reverts commit 70d18bec4281edd7bfefd600ccb683d0411bb31b.
They're back!
Bug: 215037384
Test: N/A
Change-Id: Ie37d3acfa475514b5270e04a0a1dcbd0b1f238ad
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
index 2754150..244ec4b 100644
--- a/aidl_const_expressions.cpp
+++ b/aidl_const_expressions.cpp
@@ -361,6 +361,10 @@
AidlConstantValue* AidlConstantValue::Character(const AidlLocation& location, char value) {
const std::string explicit_value = string("'") + value + "'";
+ if (!isValidLiteralChar(value)) {
+ AIDL_ERROR(location) << "Invalid character literal " << value;
+ return new AidlConstantValue(location, Type::ERROR, explicit_value);
+ }
return new AidlConstantValue(location, Type::CHARACTER, explicit_value);
}