Commit Graph

20 Commits

Author SHA1 Message Date
Roberto Ierusalimschy
9e99f3071d Merge branch 'master' into nextversion 2023-11-07 17:25:46 -03:00
Roberto Ierusalimschy
6baee9ef9d Removed test for "corrupted binary dump"
Test is too non portable. (For instance, it does not work for
different number types.)
2023-09-08 16:19:21 -03:00
Roberto Ierusalimschy
c815c2f0eb Merge branch 'master' into nextversion 2023-08-23 15:14:03 -03:00
Roberto Ierusalimschy
cbae016202 Details 2023-07-03 14:12:54 -03:00
Roberto Ierusalimschy
ab6a949522 Merge branch 'master' into nextversion 2023-06-22 11:41:48 -03:00
Roberto Ierusalimschy
ab859fe59b Bug: Loading a corrupted binary file can segfault
The size of the list of upvalue names are stored separated from the
size of the list of upvalues, but they share the same array.
2023-03-17 15:52:09 -03:00
Roberto Ierusalimschy
b5ab31a475 Merge branch 'master' into nextversion 2022-12-28 18:38:20 -03:00
Roberto Ierusalimschy
314745ed84 Avoid excessive name pollution in test files
Test files are more polite regarding the use of globals when locals
would do, and when globals are necessary deleting them after use.
2022-12-28 18:34:11 -03:00
Roberto Ierusalimschy
540d805226 Towards Lua 5.5 2022-12-20 13:24:43 -03:00
Roberto Ierusalimschy
7d6a97e42b Dump doesn't need to reuse 'source'
All strings are being reused now, including 'source'.
2022-12-20 11:14:52 -03:00
Roberto Ierusalimschy
d61b0c6028 More checks and documentation for uses of EXTRA_STACK 2022-05-26 15:14:54 -03:00
Roberto Ierusalimschy
6bc0f13505 Fixed bug of long strings in binary chunks
When "undumping" a long string, the function 'loadVector' can call the
reader function, which can run the garbage collector, which can collect
the string being read. So, the string must be anchored during the call
to 'loadVector'.
2020-08-18 14:42:11 -03:00
Roberto Ierusalimschy
422ce50d2e Fixed detail in 'loadUpvalues'
In 'lundump.c', when loading the upvalues of a function, there can be
a read error if the chunk is truncated. In that case, the creation
of the error message can trigger an emergency collection while the
prototype is still anchored. So, the prototype must be GC consistent
before loading the upvales, which implies that it the 'name' fields
must be filled with NULL before the reading.
2020-06-30 15:36:26 -03:00
Roberto Ierusalimschy
61a4e64a66 Back to old encoding of versions in binary files
(Undoing part of commit f53eabeed8.)  It is better to keep this encoding
stable, so that all Lua versions can read at least the version of a
binary file.
2020-05-06 14:19:08 -03:00
Roberto Ierusalimschy
7d526e75a7 Fixed bug in tail calls of __call chains
A tail call of a __call chain (a __call metamethod that itself is
also not a function) was being perfomed as a regular call.
2019-10-28 15:58:07 -03:00
Roberto Ierusalimschy
c1a63c45f8 '__call' metamethod can be any callable object
Removed the restriction that a '__call' metamethod must be an actual
function.
2019-06-25 17:45:50 -03:00
Roberto Ierusalimschy
8ba4523ccc 'print' does not call 'tostring' to format its arguments 2019-04-10 12:58:14 -03:00
Roberto Ierusalimschy
f53eabeed8 Small changes in the header of binary files
- LUAC_VERSION is equal to LUA_VERSION_NUM, and it is stored
as an int.

- 'sizeof(int)' and 'sizeof(size_t)' removed from the header, as
the binary format does not depend on these sizes. (It uses its
own serialization for unsigned integer values.)
2019-03-19 15:31:08 -03:00
Roberto Ierusalimschy
aa4c5cf190 Added directory to test file names in '$Id:'
From the point of view of 'git', all names are relative to the root
directory of the project. So, file names in '$Id:' also should be
relative to that directory: the proper name for test file 'all.lua'
is 'testes/all.lua'.
2018-07-25 15:31:04 -03:00
Roberto Ierusalimschy
7c519dfbd0 Added manual and tests for version 5.4-w2 2018-07-09 12:33:01 -03:00