forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/acpi/acpica/utstrsuppt.c
....@@ -45,10 +45,15 @@
4545 /* Convert each ASCII byte in the input string */
4646
4747 while (*string) {
48
-
49
- /* Character must be ASCII 0-7, otherwise terminate with no error */
50
-
48
+ /*
49
+ * Character must be ASCII 0-7, otherwise:
50
+ * 1) Runtime: terminate with no error, per the ACPI spec
51
+ * 2) Compiler: return an error
52
+ */
5153 if (!(ACPI_IS_OCTAL_DIGIT(*string))) {
54
+#ifdef ACPI_ASL_COMPILER
55
+ status = AE_BAD_OCTAL_CONSTANT;
56
+#endif
5257 break;
5358 }
5459
....@@ -94,10 +99,15 @@
9499 /* Convert each ASCII byte in the input string */
95100
96101 while (*string) {
97
-
98
- /* Character must be ASCII 0-9, otherwise terminate with no error */
99
-
102
+ /*
103
+ * Character must be ASCII 0-9, otherwise:
104
+ * 1) Runtime: terminate with no error, per the ACPI spec
105
+ * 2) Compiler: return an error
106
+ */
100107 if (!isdigit(*string)) {
108
+#ifdef ACPI_ASL_COMPILER
109
+ status = AE_BAD_DECIMAL_CONSTANT;
110
+#endif
101111 break;
102112 }
103113
....@@ -143,10 +153,15 @@
143153 /* Convert each ASCII byte in the input string */
144154
145155 while (*string) {
146
-
147
- /* Must be ASCII A-F, a-f, or 0-9, otherwise terminate with no error */
148
-
156
+ /*
157
+ * Character must be ASCII A-F, a-f, or 0-9, otherwise:
158
+ * 1) Runtime: terminate with no error, per the ACPI spec
159
+ * 2) Compiler: return an error
160
+ */
149161 if (!isxdigit(*string)) {
162
+#ifdef ACPI_ASL_COMPILER
163
+ status = AE_BAD_HEX_CONSTANT;
164
+#endif
150165 break;
151166 }
152167