lua-users home
lua-l archive

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


Andreas Stenius wrote:
> -   e1-> = e2->; e1->u.s.aux = e2->u.s.aux;
> +   e1->u = e2->u;

Ok, this is a serious bug in Lua 5.1. It's only visible if
sizeof(int)*2 < sizeof(lua_Number). I.e. it probably only affects
16 bit CPUs with lua_Number defined as a double. But the original
assignments depend on a side-effect (full overlap) not guaranteed
by the standard (even on 32/64 bit CPUs).

But the fix bears the question: is union assignment part of C89?