From b80077b8f3e27a94c6afa895b41a9f8b52c42e61 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Jul 2019 14:59:39 -0300 Subject: Change in the handling of 'L->top' when calling metamethods Instead of updating 'L->top' in every place that may call a metamethod, the metamethod functions themselves (luaT_trybinTM and luaT_callorderTM) correct the top. (When calling metamethods from the C API, however, the callers must preserve 'L->top'.) --- lopcodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lopcodes.c') diff --git a/lopcodes.c b/lopcodes.c index 23c3a6e4..ee795786 100644 --- a/lopcodes.c +++ b/lopcodes.c @@ -101,7 +101,7 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { ,opmode(0, 1, 0, 0, iABC) /* OP_SETLIST */ ,opmode(0, 0, 0, 1, iABx) /* OP_CLOSURE */ ,opmode(1, 0, 0, 1, iABC) /* OP_VARARG */ - ,opmode(0, 0, 0, 1, iABC) /* OP_VARARGPREP */ + ,opmode(0, 1, 0, 1, iABC) /* OP_VARARGPREP */ ,opmode(0, 0, 0, 0, iAx) /* OP_EXTRAARG */ }; -- cgit v1.2.3-55-g6feb