[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Enabling __eq metamethod for numbers
- From: Flyer31 Test <flyer31@...>
- Date: Fri, 21 Jan 2022 08:30:06 +0100
PS: sorry I overlooked this in the existing / old "..." text, you can
then comment out these lines:
// case LUA_VUSERDATA: {
// if (uvalue(t1) == uvalue(t2)) return 1;
// else if (L == NULL) return 0;
// tm = fasttm(L, uvalue(t1)->metatable, TM_EQ);
// if (tm == NULL)
// tm = fasttm(L, uvalue(t2)->metatable, TM_EQ);
// break; /* will try TM */
// }
(so mainly you just shift this block to the function start and do it
also already, if only ONE of two operands is LUA_VUSERDATA).
Further I needed a line change in function luaV_execute for the
switch-case-block vmcase(OP_EQK):
+ Protect(cond = luaV_equalobj(L, s2v(ra), rb));
- cond = luaV_equalobj(L, s2v(ra), rb);
.. so I added this "Protect(...)" there - do not ask me why, I did not
write a comment there... .