From 06c0b8f6e17446a71001eaa50a5167b1395511ab Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 12 Sep 2018 00:06:48 +0200 Subject: [PATCH] And back to Windows ... re-inserting the ruby_sysinit workaround. --- src/rba/rba/rba.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index db89177cf..008349bd3 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -1780,9 +1780,12 @@ RubyInterpreter::initialize (int &main_argc, char **main_argv, int (*main_func) char **argv = argvv; #if HAVE_RUBY_VERSION_CODE>=10900 - // Make sure we call ruby_sysinit because otherwise the program will crash (this + // Make sure we call ruby_sysinit on Windows because otherwise the program will crash (this // has been observed on Windows under MSVC 2017 with Ruby 2.5.1 for example) - ruby_sysinit (&argc, &argv); + // ruby_sysinit will restore the argc/argv to their originals, so we use copies here. + int xargc = argc; + char **xargv = argv; + ruby_sysinit (&xargc, &xargv); #endif {