lua-users home
lua-l archive

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


> This lua_assert: https://github.com/lua/lua/blob/6bc0f13505bf5d4f613d725fe008c79e72f83ddf/lstring.c#L206
> 
> Should be two lines higher, before the call to luaS_hash, which dereferences str unconditionally.

'luaS_hash' does not dereference 'str' unconditionally, only when 'l' is
not zero. This assertion exists because 'memcpy' should not be called
with a NULL string even when the length is zero.

-- Roberto