script_core 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (381) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +8 -6
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -1
  6. data/bin/sandbox +1 -1
  7. data/ext/enterprise_script_service/Rakefile +1 -1
  8. data/ext/enterprise_script_service/flags.rb +5 -0
  9. data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
  10. data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
  11. data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
  12. data/ext/enterprise_script_service/libseccomp/README.md +1 -1
  13. data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
  14. data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
  15. data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
  16. data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
  17. data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
  18. data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
  19. data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
  20. data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
  21. data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
  22. data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
  23. data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
  24. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
  25. data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
  26. data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
  27. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
  28. data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
  29. data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
  30. data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
  31. data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
  32. data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
  33. data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
  34. data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
  35. data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
  36. data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
  37. data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
  38. data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
  39. data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
  40. data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
  41. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
  42. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
  43. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
  44. data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
  45. data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
  46. data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
  47. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
  48. data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
  49. data/ext/enterprise_script_service/mruby/.gitignore +2 -2
  50. data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
  51. data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
  52. data/ext/enterprise_script_service/mruby/README.md +21 -8
  53. data/ext/enterprise_script_service/mruby/Rakefile +4 -13
  54. data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
  55. data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
  56. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
  57. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
  58. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
  59. data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
  60. data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
  61. data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
  62. data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
  63. data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
  64. data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
  65. data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
  66. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
  67. data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
  68. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
  69. data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
  70. data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
  71. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
  72. data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
  73. data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
  74. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
  75. data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
  76. data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
  77. data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
  78. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
  79. data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
  80. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
  81. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
  82. data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
  83. data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
  84. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
  85. data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
  86. data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
  87. data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
  88. data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
  89. data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
  90. data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
  91. data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
  92. data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
  93. data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
  94. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
  95. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
  96. data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
  97. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
  98. data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
  99. data/ext/enterprise_script_service/mruby/minirake +27 -11
  100. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
  101. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
  102. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
  103. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
  104. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
  105. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
  106. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
  107. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
  108. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
  109. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
  110. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
  111. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
  112. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
  113. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
  114. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
  115. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
  116. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
  117. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
  118. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
  119. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
  120. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
  121. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
  122. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
  123. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
  124. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
  125. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
  126. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
  127. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
  128. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
  129. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
  130. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
  131. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
  132. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
  133. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
  134. data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
  135. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
  136. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
  137. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
  138. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
  139. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
  140. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
  141. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
  142. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
  143. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
  144. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
  145. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
  146. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
  147. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
  148. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
  149. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
  150. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
  151. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
  152. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
  153. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
  154. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
  155. data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
  156. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
  157. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
  158. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
  159. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
  160. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
  161. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
  162. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
  163. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
  164. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
  165. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
  166. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
  167. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
  168. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
  169. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
  170. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
  171. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
  172. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
  173. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
  174. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
  175. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
  176. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
  177. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
  178. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
  179. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
  180. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
  181. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
  182. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
  183. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
  184. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
  185. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
  186. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
  187. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
  188. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
  189. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
  190. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
  191. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
  192. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
  193. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
  194. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
  195. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
  196. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
  197. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
  198. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
  199. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
  200. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
  201. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
  202. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
  203. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
  204. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
  205. data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
  206. data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
  207. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
  208. data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
  209. data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
  210. data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
  211. data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
  212. data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
  213. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
  214. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
  215. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
  216. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
  217. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
  218. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
  219. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
  220. data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
  221. data/ext/enterprise_script_service/mruby/src/array.c +95 -46
  222. data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
  223. data/ext/enterprise_script_service/mruby/src/class.c +370 -278
  224. data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
  225. data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
  226. data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
  227. data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
  228. data/ext/enterprise_script_service/mruby/src/error.c +157 -55
  229. data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
  230. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
  231. data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
  232. data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
  233. data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
  234. data/ext/enterprise_script_service/mruby/src/load.c +40 -76
  235. data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
  236. data/ext/enterprise_script_service/mruby/src/object.c +16 -39
  237. data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
  238. data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
  239. data/ext/enterprise_script_service/mruby/src/range.c +22 -35
  240. data/ext/enterprise_script_service/mruby/src/state.c +5 -94
  241. data/ext/enterprise_script_service/mruby/src/string.c +874 -710
  242. data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
  243. data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
  244. data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
  245. data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
  246. data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
  247. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
  248. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
  249. data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
  250. data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
  251. data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
  252. data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
  253. data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
  254. data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
  255. data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
  256. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
  257. data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
  258. data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
  259. data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
  260. data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
  261. data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
  262. data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
  263. data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
  264. data/ext/enterprise_script_service/mruby_config.rb +10 -0
  265. data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
  266. data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
  267. data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
  268. data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
  269. data/ext/enterprise_script_service/msgpack/README.md +1 -1
  270. data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
  271. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
  272. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
  273. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
  274. data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
  275. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
  276. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
  277. data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
  278. data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
  279. data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
  280. data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
  281. data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
  282. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
  283. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
  284. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
  285. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
  286. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
  287. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
  288. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
  289. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
  290. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
  291. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
  292. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
  293. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
  294. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
  295. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
  296. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
  297. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
  298. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
  299. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
  300. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
  301. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
  302. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
  303. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
  304. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
  305. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
  306. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
  307. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
  308. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
  309. data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
  310. data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
  311. data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
  312. data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
  313. data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
  314. data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
  315. data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
  316. data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
  317. data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
  318. data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
  319. data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
  320. data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
  321. data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
  322. data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
  323. data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
  324. data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
  325. data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
  326. data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
  327. data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
  328. data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
  329. data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
  330. data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
  331. data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
  332. data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
  333. data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
  334. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
  335. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
  336. data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
  337. data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
  338. data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
  339. data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
  340. data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
  341. data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
  342. data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
  343. data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
  344. data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
  345. data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
  346. data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
  347. data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
  348. data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
  349. data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
  350. data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
  351. data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
  352. data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
  353. data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
  354. data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
  355. data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
  356. data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
  357. data/lib/script_core/version.rb +1 -1
  358. data/lib/tasks/mruby/engine.gembox.example +1 -0
  359. data/lib/tasks/script_core.rake +21 -3
  360. data/spec/dummy/app/helpers/fields_helper.rb +2 -2
  361. data/spec/dummy/mruby/engine.gembox +1 -0
  362. data/spec/script_core_spec.rb +1 -1
  363. metadata +38 -22
  364. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
  365. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
  366. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
  367. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
  368. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
  369. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
  370. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
  371. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
  372. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
  373. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
  374. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
  375. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
  376. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
  377. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
  378. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
  379. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
  380. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
  381. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -423,10 +423,11 @@ def test(block)
423
423
  end
424
424
 
425
425
  assert('method definition in cmdarg') do
426
- if false
426
+ result = class MethodDefinitionInCmdarg
427
+ def self.bar(arg); arg end
427
428
  bar def foo; self.each do end end
428
429
  end
429
- true
430
+ assert_equal(:foo, result)
430
431
  end
431
432
 
432
433
  assert('optional argument in the rhs default expressions') do
@@ -450,6 +451,18 @@ def t2(foo = foo())
450
451
  assert_nil(Proc.new {|foo = foo| foo}.call)
451
452
  end
452
453
 
454
+ assert('local variable definition in default value and subsequent arguments') do
455
+ def m(a = b = 1, c) [a, b, c] end
456
+ assert_equal([1, 1, :c], m(:c))
457
+ assert_equal([:a, nil, :c], m(:a, :c))
458
+
459
+ def m(a = b = 1, &c) [a, b, c ? true : nil] end
460
+ assert_equal([1, 1, nil], m)
461
+ assert_equal([1, 1, true], m{})
462
+ assert_equal([:a, nil, nil], m(:a))
463
+ assert_equal([:a, nil, true], m(:a){})
464
+ end
465
+
453
466
  assert('multiline comments work correctly') do
454
467
  =begin
455
468
  this is a comment with nothing after begin and end
@@ -653,4 +666,8 @@ def m a, b=1, *c, d, e:, f: 2, g:, **k, &l
653
666
  result = m(1, 2, e: 3, g: 4, h: 5, i: 6, &(l = ->{}))
654
667
  assert_equal([1, 1, [], 2, 3, 2, 4, { h: 5, i: 6 }, l], result)
655
668
  =end
669
+
670
+ def m(a: b = 1, c:) [a, b, c] end
671
+ assert_equal([1, 1, :c], m(c: :c))
672
+ assert_equal([:a, nil, :c], m(a: :a, c: :c))
656
673
  end
@@ -0,0 +1,92 @@
1
+ def assert_format(exp, args)
2
+ assert_equal(exp, TestVFormat.format(*args))
3
+ end
4
+
5
+ def assert_format_pattern(exp_pattern, args)
6
+ assert_match(exp_pattern, TestVFormat.format(*args))
7
+ end
8
+
9
+ # Pass if ArgumentError is raised or return value is +exp+.
10
+ def assert_implementation_dependent(exp, args)
11
+ begin
12
+ ret = TestVFormat.format(*args)
13
+ rescue ArgumentError
14
+ return pass
15
+ end
16
+ if ret == exp
17
+ pass
18
+ else
19
+ flunk "", "Expected ArgumentError is raised or #{ret.inspect} to be #{exp}."
20
+ end
21
+ end
22
+
23
+ def sclass(v)
24
+ class << v
25
+ self
26
+ end
27
+ end
28
+
29
+ assert('mrb_vformat') do
30
+ n = TestVFormat::Native
31
+ assert_format '', ['']
32
+ assert_format 'No specifier!', ['No specifier!']
33
+ assert_format '`c`: C', ['`c`: %c', n.c(?C)]
34
+ assert_format '`d`: 123', ['`d`: %d', n.d(123)]
35
+ assert_format '`d`: -79', ['`d`: %d', n.d(-79)]
36
+ assert_format '`i`: 514', ['`i`: %i', n.i(514)]
37
+ assert_format '`i`: -83', ['`i`: %i', n.i(-83)]
38
+ assert_format '`t`: NilClass', ['`t`: %t', nil]
39
+ assert_format '`t`: FalseClass', ['`t`: %t', false]
40
+ assert_format '`t`: TrueClass', ['`t`: %t', true]
41
+ assert_format '`t`: Fixnum', ['`t`: %t', 0]
42
+ assert_format '`t`: Hash', ['`t`: %t', k: "value"]
43
+ assert_format_pattern '#<Class:#<Class:#<Hash:0x*>>>', ['%t', sclass({})]
44
+ # assert_format 'string and length', ['string %l length', n.s('andante'), n.l(3)]
45
+ assert_format '`n`: sym', ['`n`: %n', n.n(:sym)]
46
+ assert_format '%C文字列%', ['%s', n.s('%C文字列%')]
47
+ assert_format '`C`: Kernel module', ['`C`: %C module', n.C(Kernel)]
48
+ assert_format '`C`: NilClass', ['`C`: %C', n.C(nil.class)]
49
+ assert_format_pattern '#<Class:#<String:0x*>>', ['%C', n.C(sclass(""))]
50
+ assert_format '`T`: NilClass', ['`T`: %T', nil]
51
+ assert_format '`T`: FalseClass', ['`T`: %T', false]
52
+ assert_format '`T`: TrueClass', ['`T`: %T', true]
53
+ assert_format '`T`: Fixnum', ['`T`: %T', 0]
54
+ assert_format '`T`: Hash', ['`T`: %T', k: "value"]
55
+ assert_format_pattern 'Class', ['%T', sclass({})]
56
+ assert_format '`Y`: nil', ['`Y`: %Y', nil]
57
+ assert_format '`Y`: false', ['`Y`: %Y', false]
58
+ assert_format '`Y`: true', ['`Y`: %Y', true]
59
+ assert_format '`Y`: Fixnum', ['`Y`: %Y', 0]
60
+ assert_format '`Y`: Hash', ['`Y`: %Y', k: "value"]
61
+ assert_format 'Class', ['%Y', sclass({})]
62
+ assert_format_pattern '#<Class:#<String:0x*>>', ['%v', sclass("")]
63
+ assert_format '`v`: 1...3', ['`v`: %v', 1...3]
64
+ assert_format '`S`: {:a=>1, "b"=>"c"}', ['`S`: %S', a: 1, "b" => ?c]
65
+ assert_format 'percent: %', ['percent: %%']
66
+ assert_format '"I": inspect char', ['%!c: inspect char', n.c(?I)]
67
+ assert_format '709: inspect mrb_int', ['%!d: inspect mrb_int', n.i(709)]
68
+ # assert_format '"a\x00b\xff"', ['%!l', n.s("a\000b\xFFc\000d"), n.l(4)]
69
+ assert_format ':"&.": inspect symbol', ['%!n: inspect symbol', n.n(:'&.')]
70
+ assert_format 'inspect "String"', ['inspect %!v', 'String']
71
+ assert_format 'inspect Array: [1, :x, {}]', ['inspect Array: %!v', [1,:x,{}]]
72
+ assert_format_pattern '`!C`: #<Class:0x*>', ['`!C`: %!C', n.C(Class.new)]
73
+ assert_format 'to_s -> to_s: ab,cd', ['to_s -> to_s: %n,%v', n.n(:ab), 'cd']
74
+ assert_format 'to_s -> inspect: x:y', ['to_s -> inspect: %v%!v', 'x', :y]
75
+ assert_format 'inspect -> to_s: "a"b', ['inspect -> to_s: %!v%n', 'a', n.n(:b)]
76
+ assert_format 'Y -> to_s: nile', ['Y -> to_s: %Y%v', nil, "e"]
77
+ assert_format '"abc":Z', ['%!s%!n', n.s('abc'), n.n('Z'.to_sym)]
78
+ assert_format 'escape: \\%a,b,c,d', ['escape: \\\\\%a,b,\c%v', ',d']
79
+
80
+ assert_implementation_dependent 'unknown specifier: %^',
81
+ ['unknown specifier: %^']
82
+ assert_implementation_dependent 'unknown specifier with modifier: %!^',
83
+ ['unknown specifier with modifier: %!^']
84
+ assert_implementation_dependent 'termination is \\', ['termination is \\']
85
+ assert_implementation_dependent 'termination is %', ['termination is %']
86
+ assert_implementation_dependent 'termination is %!', ['termination is %!']
87
+
88
+ skip unless Object.const_defined?(:Float)
89
+ assert_format '`f`: 0.0125', ['`f`: %f', n.f(0.0125)]
90
+ assert_format '-Infinity', ['%f', n.f(-Float::INFINITY)]
91
+ assert_format 'NaN: Not a Number', ['%f: Not a Number', n.f(Float::NAN)]
92
+ end
@@ -18,7 +18,7 @@
18
18
 
19
19
  # include all core GEMs
20
20
  conf.gembox 'full-core'
21
- conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
21
+ conf.cc.defines += %w(MRB_ENABLE_DEBUG_HOOK)
22
22
 
23
23
  conf.enable_test
24
24
  end
@@ -40,7 +40,7 @@
40
40
  toolchain :gcc
41
41
 
42
42
  conf.gembox 'full-core'
43
- conf.cc.flags += %w(-Werror=declaration-after-statement -fpermissive)
43
+ conf.cc.flags += %w(-fpermissive)
44
44
  conf.compilers.each do |c|
45
45
  c.defines += %w(MRB_GC_FIXED_ARENA)
46
46
  end
@@ -11,6 +11,8 @@
11
11
  Pathname.new(__FILE__).dirname.join("mruby_engine")
12
12
  end
13
13
 
14
+ # https://github.com/mruby/mruby/blob/master/doc/guides/compile.md
15
+
14
16
  MRuby::Build.new do |conf|
15
17
  toolchain(:gcc)
16
18
 
@@ -27,6 +29,10 @@
27
29
  cc.flags += Flags.cflags
28
30
  cc.defines += Flags.io_safe_defines
29
31
  end
32
+
33
+ conf.linker do |linker|
34
+ linker.library_paths += Flags.library_paths
35
+ end
30
36
  end
31
37
 
32
38
  MRuby::CrossBuild.new("sandbox") do |conf|
@@ -43,4 +49,8 @@
43
49
  cc.flags += Flags.cflags
44
50
  cc.defines += Flags.defines
45
51
  end
52
+
53
+ conf.linker do |linker|
54
+ linker.library_paths += Flags.library_paths
55
+ end
46
56
  end
@@ -164,7 +164,7 @@ bool me_mruby_engine_get_quota_exception_raised(struct me_mruby_engine *self) {
164
164
  static void mruby_engine_code_fetch_hook(
165
165
  struct mrb_state* mrb,
166
166
  struct mrb_irep *irep,
167
- mrb_code *pc,
167
+ const mrb_code *pc,
168
168
  mrb_value *regs)
169
169
  {
170
170
  (void)irep;
@@ -202,7 +202,7 @@ struct me_mruby_engine *me_mruby_engine_new(
202
202
  }
203
203
 
204
204
  mrb_define_class(self->state, "ExitException", mrb_class_get(self->state, "Exception"));
205
- mrb_define_method(self->state , self->state->kernel_module, "exit", mruby_engine_exit, 1);
205
+ mrb_define_method(self->state , self->state->kernel_module, "exit", mruby_engine_exit, MRB_ARGS_NONE());
206
206
 
207
207
  self->instruction_quota = instruction_quota;
208
208
  self->instruction_count = 0;
@@ -4,6 +4,7 @@ MRuby::GemBox.new do |conf|
4
4
  conf.gem(core: "mruby-math")
5
5
  conf.gem(core: "mruby-time")
6
6
  conf.gem(core: "mruby-struct")
7
+ conf.gem(core: "mruby-compar-ext")
7
8
  conf.gem(core: "mruby-enum-ext")
8
9
  conf.gem(core: "mruby-string-ext")
9
10
  conf.gem(core: "mruby-numeric-ext")
@@ -1,3 +1,17 @@
1
+ # 2019-05-27 version 3.2.0
2
+
3
+ * Fix invalid include (#783)
4
+ * Add timespec support (#781)
5
+ * Fix unchecked fnprintf on C (#780)
6
+ * Improve integer overflow checking on C (#776)
7
+ * Fix warnings on `-Wconversion` (#770, #777, #784)
8
+ * Fix invalid passed by value on aligned_zone_size_visitor (#764)
9
+ * Improve windows support (#757, #779)
10
+ * Fix msgpack::object size caluclation error (#754)
11
+ * Fix memory error on example code (#753)
12
+ * Fix redundant memory allocation on C (#747)
13
+ * Fix msgpack::type::tuple base class conversion (#743)
14
+
1
15
  # 2018-09-09 version 3.1.1
2
16
 
3
17
  * Add force endian set functionality (#736)
@@ -190,6 +190,7 @@ IF (MSGPACK_ENABLE_CXX)
190
190
  include/msgpack/adaptor/cpp11/forward_list.hpp
191
191
  include/msgpack/adaptor/cpp11/reference_wrapper.hpp
192
192
  include/msgpack/adaptor/cpp11/shared_ptr.hpp
193
+ include/msgpack/adaptor/cpp11/timespec.hpp
193
194
  include/msgpack/adaptor/cpp11/tuple.hpp
194
195
  include/msgpack/adaptor/cpp11/unique_ptr.hpp
195
196
  include/msgpack/adaptor/cpp11/unordered_map.hpp
@@ -231,6 +232,7 @@ IF (MSGPACK_ENABLE_CXX)
231
232
  include/msgpack/adaptor/vector_bool.hpp
232
233
  include/msgpack/adaptor/vector_char.hpp
233
234
  include/msgpack/adaptor/vector_unsigned_char.hpp
235
+ include/msgpack/adaptor/wstring.hpp
234
236
  include/msgpack/cpp_config.hpp
235
237
  include/msgpack/cpp_config_decl.hpp
236
238
  include/msgpack/create_object_visitor.hpp
@@ -551,6 +553,7 @@ IF (MSGPACK_ENABLE_CXX)
551
553
  include/msgpack/v1/adaptor/cpp11/forward_list.hpp
552
554
  include/msgpack/v1/adaptor/cpp11/reference_wrapper.hpp
553
555
  include/msgpack/v1/adaptor/cpp11/shared_ptr.hpp
556
+ include/msgpack/v1/adaptor/cpp11/timespec.hpp
554
557
  include/msgpack/v1/adaptor/cpp11/tuple.hpp
555
558
  include/msgpack/v1/adaptor/cpp11/unique_ptr.hpp
556
559
  include/msgpack/v1/adaptor/cpp11/unordered_map.hpp
@@ -605,6 +608,7 @@ IF (MSGPACK_ENABLE_CXX)
605
608
  include/msgpack/v1/adaptor/vector_bool.hpp
606
609
  include/msgpack/v1/adaptor/vector_char.hpp
607
610
  include/msgpack/v1/adaptor/vector_unsigned_char.hpp
611
+ include/msgpack/v1/adaptor/wstring.hpp
608
612
  include/msgpack/v1/cpp_config.hpp
609
613
  include/msgpack/v1/cpp_config_decl.hpp
610
614
  include/msgpack/v1/detail/cpp03_zone.hpp
@@ -1,7 +1,7 @@
1
1
  `msgpack` for C/C++
2
2
  ===================
3
3
 
4
- Version 3.1.1 [![Build Status](https://travis-ci.org/msgpack/msgpack-c.svg?branch=master)](https://travis-ci.org/msgpack/msgpack-c) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
4
+ Version 3.2.0 [![Build Status](https://travis-ci.org/msgpack/msgpack-c.svg?branch=master)](https://travis-ci.org/msgpack/msgpack-c) [![Build status](https://ci.appveyor.com/api/projects/status/8kstcgt79qj123mw/branch/master?svg=true)](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
5
5
 
6
6
  It's like JSON but smaller and faster.
7
7
 
@@ -1,4 +1,4 @@
1
- version: 3.1.1.{build}
1
+ version: 3.2.0.{build}
2
2
 
3
3
  image:
4
4
  - Visual Studio 2015
@@ -121,7 +121,7 @@ inline tuple<> make_tuple()
121
121
  /// @cond
122
122
  <%0.upto(GENERATION_LIMIT) {|i|%>
123
123
  template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
124
- inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
124
+ tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(A0 const& a0<%1.upto(i) {|j|%>, A<%=j%> const& a<%=j%><%}%>)
125
125
  {
126
126
  return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
127
127
  }
@@ -54,7 +54,7 @@ tuple<> make_tuple();
54
54
  /// @cond
55
55
  <%0.upto(GENERATION_LIMIT) {|i|%>
56
56
  template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
57
- tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>);
57
+ tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(A0 const& a0<%1.upto(i) {|j|%>, A<%=j%> const& a<%=j%><%}%>);
58
58
  <%}%>
59
59
  /// @endcond
60
60
 
@@ -55,7 +55,7 @@ class zone {
55
55
  ++m_tail;
56
56
  }
57
57
  void push_expand(void (*func)(void*), void* data) {
58
- const size_t nused = m_end - m_array;
58
+ const size_t nused = static_cast<size_t>(m_end - m_array);
59
59
  size_t nnext;
60
60
  if(nused == 0) {
61
61
  nnext = (sizeof(finalizer) < 72/2) ?
@@ -201,12 +201,12 @@ inline char* zone::get_aligned(char* ptr, size_t align)
201
201
  inline void* zone::allocate_align(size_t size, size_t align)
202
202
  {
203
203
  char* aligned = get_aligned(m_chunk_list.m_ptr, align);
204
- size_t adjusted_size = size + (aligned - m_chunk_list.m_ptr);
204
+ size_t adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
205
205
  if (m_chunk_list.m_free < adjusted_size) {
206
206
  size_t enough_size = size + align - 1;
207
207
  char* ptr = allocate_expand(enough_size);
208
208
  aligned = get_aligned(ptr, align);
209
- adjusted_size = size + (aligned - m_chunk_list.m_ptr);
209
+ adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
210
210
  }
211
211
  m_chunk_list.m_free -= adjusted_size;
212
212
  m_chunk_list.m_ptr += adjusted_size;
@@ -38,8 +38,8 @@ int main() {
38
38
  std::cout << __LINE__ << ":" << e.message() << std::endl;
39
39
  return;
40
40
  }
41
- unp.reserve_buffer(window_size);
42
41
  do_async_read_some = [&] {
42
+ unp.reserve_buffer(window_size);
43
43
  ss.async_read_some(
44
44
  boost::asio::buffer(unp.buffer(), window_size),
45
45
  [&](boost::system::error_code const& e, std::size_t bytes_transferred) {
@@ -0,0 +1,16 @@
1
+ //
2
+ // MessagePack for C++ static resolution routine
3
+ //
4
+ // Copyright (C) 2019 KONDO Takatoshi
5
+ //
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // (See accompanying file LICENSE_1_0.txt or copy at
8
+ // http://www.boost.org/LICENSE_1_0.txt)
9
+ //
10
+
11
+ #ifndef MSGPACK_TYPE_CPP11_TIMESPEC_HPP
12
+ #define MSGPACK_TYPE_CPP11_TIMESPEC_HPP
13
+
14
+ #include "msgpack/v1/adaptor/cpp11/timespec.hpp"
15
+
16
+ #endif // MSGPACK_TYPE_CPP11_TIMESPEC_HPP
@@ -0,0 +1,15 @@
1
+ //
2
+ // MessagePack for C++ static resolution routine
3
+ //
4
+ // Copyright (C) 2018 KONDO Takatoshi
5
+ //
6
+ // Distributed under the Boost Software License, Version 1.0.
7
+ // (See accompanying file LICENSE_1_0.txt or copy at
8
+ // http://www.boost.org/LICENSE_1_0.txt)
9
+ //
10
+ #ifndef MSGPACK_TYPE_WSTRING_HPP
11
+ #define MSGPACK_TYPE_WSTRING_HPP
12
+
13
+ #include "msgpack/v1/adaptor/wstring.hpp"
14
+
15
+ #endif // MSGPACK_TYPE_WSTRING_HPP
@@ -97,8 +97,10 @@ typedef struct msgpack_object_kv {
97
97
  msgpack_object val;
98
98
  } msgpack_object_kv;
99
99
 
100
+ #if !defined(_KERNEL_MODE)
100
101
  MSGPACK_DLLEXPORT
101
102
  void msgpack_object_print(FILE* out, msgpack_object o);
103
+ #endif
102
104
 
103
105
  MSGPACK_DLLEXPORT
104
106
  int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
@@ -34,6 +34,10 @@
34
34
  #error msgpack_pack_append_buffer callback is not defined
35
35
  #endif
36
36
 
37
+ #if defined(_MSC_VER)
38
+ # pragma warning(push)
39
+ # pragma warning(disable : 4204) /* nonstandard extension used: non-constant aggregate initializer */
40
+ #endif
37
41
 
38
42
  /*
39
43
  * Integer
@@ -834,31 +838,31 @@ msgpack_pack_inline_func(_ext)(msgpack_pack_user x, size_t l, int8_t type)
834
838
  case 1: {
835
839
  unsigned char buf[2];
836
840
  buf[0] = 0xd4;
837
- buf[1] = type;
841
+ buf[1] = (unsigned char)type;
838
842
  msgpack_pack_append_buffer(x, buf, 2);
839
843
  } break;
840
844
  case 2: {
841
845
  unsigned char buf[2];
842
846
  buf[0] = 0xd5;
843
- buf[1] = type;
847
+ buf[1] = (unsigned char)type;
844
848
  msgpack_pack_append_buffer(x, buf, 2);
845
849
  } break;
846
850
  case 4: {
847
851
  unsigned char buf[2];
848
852
  buf[0] = 0xd6;
849
- buf[1] = type;
853
+ buf[1] = (unsigned char)type;
850
854
  msgpack_pack_append_buffer(x, buf, 2);
851
855
  } break;
852
856
  case 8: {
853
857
  unsigned char buf[2];
854
858
  buf[0] = 0xd7;
855
- buf[1] = type;
859
+ buf[1] = (unsigned char)type;
856
860
  msgpack_pack_append_buffer(x, buf, 2);
857
861
  } break;
858
862
  case 16: {
859
863
  unsigned char buf[2];
860
864
  buf[0] = 0xd8;
861
- buf[1] = type;
865
+ buf[1] = (unsigned char)type;
862
866
  msgpack_pack_append_buffer(x, buf, 2);
863
867
  } break;
864
868
  default:
@@ -866,19 +870,19 @@ msgpack_pack_inline_func(_ext)(msgpack_pack_user x, size_t l, int8_t type)
866
870
  unsigned char buf[3];
867
871
  buf[0] = 0xc7;
868
872
  buf[1] = (unsigned char)l;
869
- buf[2] = type;
873
+ buf[2] = (unsigned char)type;
870
874
  msgpack_pack_append_buffer(x, buf, 3);
871
875
  } else if(l < 65536) {
872
876
  unsigned char buf[4];
873
877
  buf[0] = 0xc8;
874
878
  _msgpack_store16(&buf[1], l);
875
- buf[3] = type;
879
+ buf[3] = (unsigned char)type;
876
880
  msgpack_pack_append_buffer(x, buf, 4);
877
881
  } else {
878
882
  unsigned char buf[6];
879
883
  buf[0] = 0xc9;
880
884
  _msgpack_store32(&buf[1], l);
881
- buf[5] = type;
885
+ buf[5] = (unsigned char)type;
882
886
  msgpack_pack_append_buffer(x, buf, 6);
883
887
  }
884
888
  break;
@@ -893,7 +897,7 @@ msgpack_pack_inline_func(_ext_body)(msgpack_pack_user x, const void* b, size_t l
893
897
  msgpack_pack_inline_func(_timestamp)(msgpack_pack_user x, const msgpack_timestamp* d)
894
898
  {
895
899
  if ((((int64_t)d->tv_sec) >> 34) == 0) {
896
- uint64_t data64 = ((uint64_t) d->tv_nsec << 34) | d->tv_sec;
900
+ uint64_t data64 = ((uint64_t) d->tv_nsec << 34) | (uint64_t)d->tv_sec;
897
901
  if ((data64 & 0xffffffff00000000L) == 0) {
898
902
  // timestamp 32
899
903
  char buf[4];
@@ -935,3 +939,7 @@ msgpack_pack_inline_func(_timestamp)(msgpack_pack_user x, const msgpack_timestam
935
939
  #undef msgpack_pack_real_int16
936
940
  #undef msgpack_pack_real_int32
937
941
  #undef msgpack_pack_real_int64
942
+
943
+ #if defined(_MSC_VER)
944
+ # pragma warning(pop)
945
+ #endif