aligned with lua 5.2.2
refactor with NORETURN