Commit Graph

23 Commits

Author SHA1 Message Date
Ilya Leoshkevich
b0c7279c49
Merge 6a079a441b into eec7a8016c 2025-04-11 03:38:27 +02:00
Mike Pall
8358eb0cce Merge branch 'master' into v2.1 2025-01-13 16:15:19 +01:00
Mike Pall
e8236561d4 Bump copyright date. 2025-01-13 15:59:10 +01:00
Ilya Leoshkevich
6a079a441b FFI: Support VLA function parameters
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.
2024-11-12 21:33:52 +01:00
Mike Pall
ef587afb2c Merge branch 'master' into v2.1 2023-08-20 21:33:37 +02:00
Mike Pall
158a284cc9 Bump copyright date. 2023-08-20 21:25:30 +02:00
Mike Pall
7306ba78d6 Merge branch 'master' into v2.1 2022-01-15 19:42:30 +01:00
Mike Pall
c4dfb625ba Bump copyright date. 2022-01-15 19:30:54 +01:00
Mike Pall
1e66d0f9e6 Merge branch 'master' into v2.1 2021-01-02 21:56:07 +01:00
Mike Pall
f47c864b01 Bump copyright date. 2021-01-02 21:49:41 +01:00
Mike Pall
87b111f0fe Merge branch 'master' into v2.1 2020-01-20 23:34:21 +01:00
Mike Pall
38a5ed4b43 Bump copyright date. 2020-01-20 23:26:51 +01:00
Mike Pall
70f4b15ee4 FFI: Eliminate hardcoded string hashes. 2019-12-08 20:53:31 +01:00
Mike Pall
b93a1dd0c8 Bump copyright date to 2017. 2017-01-17 12:35:03 +01:00
Mike Pall
db1b399af1 Bump copyright date to 2016. 2016-03-03 12:02:22 +01:00
Mike Pall
86913b9bbf Bump copyright date to 2015. 2015-01-05 23:59:31 +01:00
Mike Pall
ef59e54820 Bump copyright date to 2014. 2014-01-16 23:10:16 +01:00
Mike Pall
4a44c4ff69 Bump copyright date to 2013. 2013-02-11 12:54:48 +01:00
Mike Pall
946c7418d5 FFI: Add support for parameterized C types. 2012-06-14 19:54:07 +02:00
Mike Pall
10ef109eef Bump copyright date to 2012. 2012-01-23 22:42:42 +01:00
Mike Pall
248cf2ffa9 FFI: Ignore number parsing errors while skipping definitions. 2011-12-17 15:02:53 +01:00
Mike Pall
06f99fc3df Bump copyright date to 2011. 2011-01-09 17:12:53 +01:00
Mike Pall
233076d3f9 FFI: Add C declaration parser. 2010-12-05 00:20:59 +01:00