3 ms·
> 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 p
by throwawaymaths 4y ago
> 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.