shithub: lu9-lua

Download patch

ref: 9aca69bafe538dfa4f8d37a1088d6e78380cbc0b
parent: 46be77621a1792431d662cb47528285aa57a1964
author: kvik <kvik@a-b.xyz>
date: Sat Feb 6 19:16:58 EST 2021

lua_newstate: acquire a private slot for errno

--- a/lstate.c
+++ b/lstate.c
@@ -398,6 +398,8 @@
     close_state(L);
     L = NULL;
   }
+  if(priv_errno == nil)
+  	priv_errno = (errno_t*)privalloc();
   return L;
 }