mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Fix arguments passed to ruby_exec_node()
in libretro builds
This is really stupid. But it seems this undefined behaviour here was causing the sporadic Ruby VM crashes I experienced before.
This commit is contained in:
parent
7d753e2655
commit
91fdc3028b
2 changed files with 2 additions and 2 deletions
|
@ -106,7 +106,7 @@ sandbox::sandbox(const char *game_path) : ruby(new struct w2c_ruby), wasi(new wa
|
|||
usize state_buf = sandbox_malloc(sizeof(usize));
|
||||
AWAIT(valid = w2c_ruby_ruby_executable_node(RB, node, state_buf));
|
||||
if (valid) {
|
||||
AWAIT(state = w2c_ruby_ruby_exec_node(RB, WASM_GET(u32, state_buf)));
|
||||
AWAIT(state = w2c_ruby_ruby_exec_node(RB, node));
|
||||
}
|
||||
if (!valid || state) {
|
||||
throw SandboxNodeException();
|
||||
|
|
|
@ -97,7 +97,7 @@ $(LIBDIR)/mkxp-retro-dist.zip: $(LIBDIR)/mkxp-retro-dist/bin/ruby $(P7ZIP)
|
|||
rm -r $(LIBDIR)/_mkxp-retro-dist/include
|
||||
rm -r $(LIBDIR)/_mkxp-retro-dist/share
|
||||
rm -r $(LIBDIR)/_mkxp-retro-dist/lib/ruby/gems/$(RUBY_VERSION).0/cache/*
|
||||
echo '# This is a Ruby script that does nothing. We make Ruby load this file on startup just because Ruby needs to load a script on startup for some reason. No, we cannot just use `-e`: for some reason that sometimes causes the Ruby VM to crash on startup.' > $(LIBDIR)/_mkxp-retro-dist/bin/mkxp-z
|
||||
echo '# This is a Ruby script that does nothing. We make Ruby load this file on startup just because Ruby needs to load a script on startup for some reason.' > $(LIBDIR)/_mkxp-retro-dist/bin/mkxp-z
|
||||
rm -f $(LIBDIR)/mkxp-retro-dist.zip
|
||||
cd $(LIBDIR)/_mkxp-retro-dist && $(P7ZIP) a -bb3 -mm=zstd -mx=19 $(LIBDIR)/mkxp-retro-dist.zip *
|
||||
rm -r $(LIBDIR)/_mkxp-retro-dist
|
||||
|
|
Loading…
Add table
Reference in a new issue