pluto fails to persist a table containing a NaN #10

Closed
wtholliday opened this Issue Feb 15, 2012 · 0 comments

2 participants

@wtholliday
local t = {}
t[1] = 0/0
buf = pluto.persist({}, t)

results in

Lua Error: table index is NaN
@hoelzro hoelzro pushed a commit that closed this issue Feb 16, 2012
@wtholliday wtholliday fix #10. Don't put simple values in reftbl.
There is no need to put simple values (nil, numbers, booleans,
lightuserdata) in the ref-table because they are pass-by-value in Lua.
This reduces ref-table lookups and allows NaN values to be persisted.
Previously, pluto would attempt to insert a NaN as a key in the
ref-table (inserting NaNs as table keys results in a Lua error).
3a4c14a
@hoelzro hoelzro closed this in 3a4c14a Feb 16, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment