franko / luajit-lang-toolkit

A Lua bytecode compiler written in Lua itself for didactic purposes or for new language implementations
Other
655 stars 91 forks source link

The mask about immutable in uv_decode is wrong #42

Closed constfold closed 4 years ago

constfold commented 4 years ago

It should be 0x4000 instead of 0x40. https://github.com/franko/luajit-lang-toolkit/blob/80688a7877ed35fddf2d5007948a7a9f7fe1ed43/lang/bcread.lua#L444 The following is its definition and usages in LuaJIT: (PROTO_UV_IMMUTABLE) https://github.com/LuaJIT/LuaJIT/blob/67654be56d0a5d644d7db04ad82d0383f21832ac/src/lj_obj.h#L400 (encode) https://github.com/LuaJIT/LuaJIT/blob/67654be56d0a5d644d7db04ad82d0383f21832ac/src/lj_parse.c#L1349 (decode) https://github.com/LuaJIT/LuaJIT/blob/67654be56d0a5d644d7db04ad82d0383f21832ac/src/lj_func.c#L148