ruby-changes:50219
From: usa <ko1@a...>
Date: Sat, 10 Feb 2018 00:28:12 +0900 (JST)
Subject: [ruby-changes:50219] usa:r62337 (trunk): append_str don't look the length of string
usa 2018-02-10 00:28:09 +0900 (Sat, 10 Feb 2018) New Revision: 62337 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62337 Log: append_str don't look the length of string * mjit.c (compile_c_to_so): use append_str2() and pass the length of so_name. append_str() uses the size of the 2nd argument, not the length of it. Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 62336) +++ mjit.c (revision 62337) @@ -686,13 +686,15 @@ compile_c_to_so(const char *c_file, cons https://github.com/ruby/ruby/blob/trunk/mjit.c#L686 char **args; #ifdef _MSC_VER char *p; + int solen; #endif input[0] = c_file; #ifdef _MSC_VER - p = (char *)output[0] = xmalloc(3 + strlen(so_file) + 1); + solen = strlen(so_file); + p = (char *)output[0] = xmalloc(3 + solen + 1); p = append_str(p, "-Fe"); - p = append_str(p, so_file); + p = append_str2(p, so_file, solen); *p = '\0'; args = form_args(4, (mjit_opts.debug ? VC_COMMON_ARGS_DEBUG : VC_COMMON_ARGS), output, input, libs); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/