glibc 2.39's regex.h contains the following declaration:
extern int regexec (const regex_t *_Restrict_ __preg,
const char *_Restrict_ __String, size_t __nmatch,
regmatch_t __pmatch[_Restrict_arr_
_REGEX_NELTS (__nmatch)],
int __eflags);
__pmatch is a VLA, which LuaJIT currently cannot parse. Implement
parsing VLA function parameters as follows:
- Allow parsing CT_FIELD identifiers. Long-term it's probably better to
define a new CT_* constant to avoid mix-ups, but currently struct
fields are not added to the hash, so in this context CT_FIELD is
guaranteed to be a function parameter.
- Allow function parameter lists to reference CT_FIELD ctypes (function
parameters are CT_FIELDs).
- Add function parameters to the hash table as they are being parsed;
remove them after the function parameter list is parsed, since they
go out of scope.
- Mark CPValues that are compile-time constants using the new "imm"
flag. Integer literals and enum members are compile-time constants;
arithmetic operations propagate this property if all operands are
compile-time constants.
- Distinguish array sizes that are compile-time constants from those
that are not. Treat variable sizes as CTSIZE_INVALID.