mjit_compile.c: fix invalid suffix on MinGW

This commit fixes following error.

$ RUBY_FORCE_TEST_JIT=1 ./ruby -I. -Ilib -Itest/lib --disable-gems test/ruby/test_jit.rb
Run options:

 # Running tests:

Environment variable changed: TestJIT#test_compile_insns : "TEMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp"
Environment variable changed: TestJIT#test_compile_insns : "TMP" changed : "C:\\msys64\\tmp" -> "C:\\Users\\k0kubun\\AppData\\Local\\Temp"
Environment variable changed: TestJIT#test_compile_insns : "temp" deleted
Environment variable changed: TestJIT#test_compile_insns : "tmp" deleted

  1) Failure:
TestJIT#test_jit_output [test/ruby/test_jit.rb:360]:
Expected /^JIT success \(\d+\.\dms\): block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/ to match "C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c: In function '_mjit0':\n" +
"C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p920u0.c:11:61: error: invalid suffix \"CD6900\" on integer constant\n" +
"     static const VALUE *const original_body_iseq = (VALUE *)0000000004CD6900;\n" +
"                                                             ^~~~~~~~~~~~~~~~\n" +
"compilation terminated due to -Wfatal-errors.\n" +
"Successful MJIT finish\n".

  2) Failure:
TestJIT#test_compile_insns [test/ruby/test_jit.rb:19]:
Expected 1 times of JIT success, but succeeded 0 times.

script:
```
p proc { nil rescue true }.call
```

stderr:
```
C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c: In function '_mjit0':
C:/Users/k0kubun/AppData/Local/temp/_ruby_mjit_p10628u0.c:11:61: error: invalid suffix "D05F10" on integer constant
     static const VALUE *const original_body_iseq = (VALUE *)0000000004D05F10;
                                                             ^~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Successful MJIT finish

```

.
<1> expected but was
<0>.

Finished tests in 3.028989s, 0.6603 tests/s, 1.9809 assertions/s.
2 tests, 6 assertions, 2 failures, 0 errors, 0 skips

ruby -v: ruby 2.6.0dev (2018-02-11 trunk 62375) [x64-mingw32]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-02-12 01:00:30 +00:00
Родитель e19457e61a
Коммит 1894e602e1
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -164,8 +164,8 @@ mjit_compile(FILE *f, const struct rb_iseq_constant_body *body, const char *func
#endif
fprintf(f, "VALUE\n%s(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp)\n{\n", funcname);
fprintf(f, " VALUE *stack = reg_cfp->sp;\n");
fprintf(f, " static const VALUE *const original_body_iseq = (VALUE *)%p;\n",
body->iseq_encoded);
fprintf(f, " static const VALUE *const original_body_iseq = (VALUE *)0x%"PRIxVALUE";\n",
(VALUE)body->iseq_encoded);
/* Simulate `opt_pc` in setup_parameters_complex */
if (body->param.flags.has_opt) {