lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Jan 20, 2012 at 11:35, Peter Cawley <lua@corsix.org> wrote:
> 2012/1/20 Pierre-Yves Gérardy <pygy79@gmail.com>:
>> local function safe_loadstring (s,chunkname)
>>   if s:match"^%.Lua" then
>>     return false, "Attempt to load bytecode." -- are there other
>> bytecode signatures?
>
> That check won't detect bytecode. You'd probably be better with "if
> s:byte() == 27 then".
>

Indeed, stupid misatke.
Thanks.
-- Pierre-Yves