News for hackers. Stuff that matters.
Re:Zig's Curious Multi-Sequence for Loops by throwawaymaths on Monday February 27, 2023 @06:14PM (#34963380)
> I can buy that dereferencing null is a special case, but why is 0x2 special?

It isn't, in the general case. But JavaScript engines do some dark magic with pointer packing / NaN boxing as a performance optimization (most things in the VM are single words, passing around a single word is usually way cheaper than full unboxing), and I suspect bun in occasionally running into issues where it gets returned something from the JS engine which it thinks is a pointer but actually it's a packed, special value. This is a logic error, that turns into a weird memory issue at the abi boundary, not a memory safety issue.

There are no comments on this comment yet.