#GitHub - eprosync/plugin_ljpatch: Patche...

1 messages · Page 1 of 1 (latest)

night berry
#

iirc table.insert was also changed to return the index to which the element was added, which seems to be missing in your LuaJIT version, which could break some things that depend on it.
The change:

fading ridge
#

Is this part of rolling release or 2.1.0 beta 3 tag?

fading ridge
#

thx i'll add it in

fading ridge
#

Got it working on all archs and platforms

#

weirdly enough found an issue with sdk-minimal, with the "serverside" attribute for premake...
doesn't realize that on x86_64 beta branch the libtier0_srv.so doesn't seem to exist on x86

fading ridge
#

@night berry https://github.com/RaphaelIT7/gmod-lua-shared/blob/main/LuaJIT-2.1/src/lj_lex.c#L370
On my build this failed on comments such as "/* **/" as it was skipping an extra token
I fixed it here with your initial:
https://github.com/eprosync/LuaJIT/blob/gmsupport/src/lj_lex.c#L318C14-L318C54

GitHub

WIP. Contribute to RaphaelIT7/gmod-lua-shared development by creating an account on GitHub.

GitHub

Mirror of the LuaJIT git repository. Contribute to eprosync/LuaJIT development by creating an account on GitHub.

fading ridge
#

@night berry Another thing I found is that lua_newthread needs to have it's luabase allocated from the main thread.
This is so that coroutines support gmod's interface, otherwise its a crash from luabase being null.
Just add a L1->luabase = L->luabase here to fix crashes with coroutines:
https://github.com/RaphaelIT7/gmod-lua-shared/blob/main/LuaJIT-2.1/src/lj_api.c#L796

GitHub

WIP. Contribute to RaphaelIT7/gmod-lua-shared development by creating an account on GitHub.

#
  • just found out about this btw on my version of LJ lmao
night berry
fading ridge
#

let me check

#

I don't think it here I might be blind tho:

night berry
#

lua_init_stack_gmod

#

That's where it sets it

#

or at least is supposed to

fading ridge
#

github isn't show me a reference to the definition of it

#

ah

#

ok its fine

#

I tested LJPatch on a 135 addon and 6 module server
just putting the L1->luabase = L->luabase in lua_newthread seems to be fine but for builds not associated with patching might break for my versions

#

lol lj_state_new is only used once 😂

night berry
#

You should probably check all the places where I had added lua_init_gmod_stack and see if your missing it in your calls anywhere.
I think in the luajit profiler callback for example it was required too

fading ridge
#

this one here you placed here but as a patch for something else breaking so I'll investigate that next

#

other than that thats really it