From 71b9532659abb531bd1597d88451426dcc895824 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 5 Jan 2021 16:48:53 +0800 Subject: update Lua. --- src/lua/llimits.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lua/llimits.h') diff --git a/src/lua/llimits.h b/src/lua/llimits.h index a76c13e..d039483 100644 --- a/src/lua/llimits.h +++ b/src/lua/llimits.h @@ -326,7 +326,8 @@ typedef l_uint32 Instruction; /* exponentiation */ #if !defined(luai_numpow) -#define luai_numpow(L,a,b) ((void)L, l_mathop(pow)(a,b)) +#define luai_numpow(L,a,b) \ + ((void)L, (b == 2) ? (a)*(a) : l_mathop(pow)(a,b)) #endif /* the others are quite standard operations */ -- cgit v1.2.3-55-g6feb