Found by a fuzzer and manually simplified. Comparison operators have
custom inlining code that wasn't checking the distance between jump
targets before compiling.
The old code had a quirk where it implicitly assumed that the capacity
was a power of 2. This actually isn't always the case for huge tables
but the side effect was just a bad distribution of keys in that case.
Either way, seems better to make sure the traversal code doesn't
diverge. Splitting into *_shallow and *_deep implementations shows the
logic better as well for the optimization.
Two bundles can now share a directory created with the same permissions.
When removing bundles, each package installs a unique ".keep" file that
must be removed before the outer directory can be removed. If we failed
to delete a directory during cleanup, it is likely because it still has
contents from other packages. The keep file means that adding directory
will also add at least 1 child file.
After adding the "too many closures" error, we tried to pop a NULL scope
during cleanup - this can segfault. Handle bad scope state better during
cleanup.
the same as our register size.
Mostly for x32, but gets rid of the hard-coded ifdef with logic that
calls out the issue and makes it clear what assumptions we are making.
Previously, we had silent miscompiles in some cases.
The ideal fix is to let us reference upvalues beyond slot 255. One way
would be to add a new instruction pair that would reference a 16-bit
constant index, which would itself encode a pair of at least 16 bit
values instead of the current instruction which encodes a pair of 8 bit
values.
Streams sent to another thread with ev/thread were only re-registered with the receiving thread's event loop on the poll backend. On kqueue and epoll, waiting on them hung forever, and on epoll closing them raised "No such file or directory".
Co-authored-by: jcates <jcates@>
GCC aligns alloca to the widest enabled vector type (16 bytes, 32 with avx,
64 with avx-512). With AVX the block address is `lea 0x1f(%rsp)` rounded down
to the nearest 32-divisible, but half the time the block starts 16 bytes higher
so the function reads the stack arguments 2 slots away from where it should.
Without AVX the address is `lea 0xf(%rsp)` which is the stack pointer.
As key types can't change during lookup, we only need to check them once. The check is now
inlined in util.h, so structs and tables can use the same implementation. (Structs had a simpler
copy of the table implementation before, now they just ignore the table specific parts as they
lack deleted buckets)
Co-authored-by: Alex Alejandre <alex@alexalejandre.com>
* Split assert-error into pieces and remove a piece
* Add helpful reminder in comment
* Format hack
* Use underscores to help readability
---------
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
* Stop using abbreviations
* Put parser tests first
* Fix incorrect code
* Deal with linting
* Change some comments and labels
* Improve test
* Use syntax literals for int/u64 and int/s64
---------
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
* Add bitwise key check to skip janet_equals calls
* Skip janet_equals for identity-comparing keys
Since symbols, keywords, non-0 numbers, bools, tables, buffers, arrays, funcs and fibers are only equal by identity, we now fail them all if the bitwise check fails instead of passing them to `janet_equals`, so lookups only call `janet_equals` for strings, tuples, structs, abstract values and 0
* Skip traversal in janet_equals for non tuples and structs
---------
Co-authored-by: Alex Alejandre <alex@alexalejandre.com>