Reject overlong host type and field names
All checks were successful
akbasic CI Build / cmake_build (push) Successful in 3m33s
akbasic CI Build / sanitizers (push) Successful in 5m5s
akbasic CI Build / coverage (push) Successful in 3m59s
akbasic CI Build / akgl_build (push) Successful in 9m35s
akbasic CI Build / mutation_test (push) Successful in 23m25s
All checks were successful
akbasic CI Build / cmake_build (push) Successful in 3m33s
akbasic CI Build / sanitizers (push) Successful in 5m5s
akbasic CI Build / coverage (push) Successful in 3m59s
akbasic CI Build / akgl_build (push) Successful in 9m35s
akbasic CI Build / mutation_test (push) Successful in 23m25s
Co-authored-by: Andrew Kesterson <andrew@starfort.tech>
This commit is contained in:
@@ -105,6 +105,8 @@ typedef struct
|
||||
* Registering before the script is loaded is the normal case. A host type and a
|
||||
* `TYPE` the script declares share one namespace, so a script cannot declare a
|
||||
* type the host already registered -- and would be refused if it tried.
|
||||
* Host type and field names are limited to 31 characters, matching
|
||||
* script-declared types and fields.
|
||||
*
|
||||
* @param obj Object to initialize, inspect, or modify.
|
||||
* @param type The host's description of its own struct.
|
||||
@@ -112,6 +114,7 @@ typedef struct
|
||||
* @throws AKERR_NULLPOINTER When either argument is NULL.
|
||||
* @throws AKBASIC_ERR_VALUE When a field name carries no type suffix, a nested
|
||||
* type is not registered, or the name is already taken.
|
||||
* @throws AKERR_OUTOFBOUNDS When a type or field name exceeds 31 characters.
|
||||
* @throws AKBASIC_ERR_BOUNDS When the type table or a field list is full.
|
||||
*/
|
||||
akerr_ErrorContext AKERR_NOIGNORE *akbasic_host_register_type(struct akbasic_Runtime *obj, const akbasic_HostType *type);
|
||||
|
||||
Reference in New Issue
Block a user