script_core 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/ext/enterprise_script_service/libseccomp/.travis.yml +3 -5
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +10 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/README.md +18 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +7 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +16 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +16 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/15-basic-resolver.c +3 -3
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.c +48 -0
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.py +38 -0
- data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tests/regression +4 -0
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -3
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby/.github/workflows/build.yml +106 -0
- data/ext/enterprise_script_service/mruby/.github/workflows/main.yml +24 -0
- data/ext/enterprise_script_service/mruby/.gitignore +3 -0
- data/ext/enterprise_script_service/mruby/.travis.yml +6 -9
- data/ext/enterprise_script_service/mruby/AUTHORS +1 -0
- data/ext/enterprise_script_service/mruby/Doxyfile +1 -1
- data/ext/enterprise_script_service/mruby/LICENSE +1 -1
- data/ext/enterprise_script_service/mruby/README.md +6 -2
- data/ext/enterprise_script_service/mruby/appveyor.yml +9 -12
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +9 -0
- data/ext/enterprise_script_service/mruby/build_config.rb +6 -6
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +6 -2
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +4 -8
- data/ext/enterprise_script_service/mruby/doc/limitations.md +10 -10
- data/ext/enterprise_script_service/mruby/doc/opcode.md +108 -95
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_ArduinoDue.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelEdison.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelGalileo.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_RX630.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_chipKITMax32.rb +2 -2
- data/ext/enterprise_script_service/mruby/examples/targets/build_config_dreamcast_shelf.rb +108 -0
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +10 -7
- data/ext/enterprise_script_service/mruby/include/mruby.h +11 -9
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +4 -0
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +11 -2
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +0 -9
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +10 -0
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +11 -3
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +1 -17
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +10 -0
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -1
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +23 -5
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +1 -0
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +3 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +2 -1
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +7 -12
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +4 -4
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +2 -30
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +21 -46
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +9 -0
- data/ext/enterprise_script_service/mruby/lib/mruby/source.rb +3 -1
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +7 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +0 -31
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +0 -13
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mrbgem.rake +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +7 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +6 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +6 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +6 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +76 -48
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +107 -32
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/y.tab.c +13153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/mrbgem.rake +13 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +2 -213
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +21 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/include/mruby/ext/io.h +39 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +2 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file_constants.rb +0 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +7 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +76 -30
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +9 -10
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +323 -120
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +18 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +32 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +57 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +15 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +9 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +3 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +113 -10
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +5 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +9 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/src/mrb_sleep.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/test/sockettest.c +3 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +61 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +5 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +1 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +6 -5
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +3 -3
- data/ext/enterprise_script_service/mruby/src/array.c +11 -0
- data/ext/enterprise_script_service/mruby/src/backtrace.c +2 -2
- data/ext/enterprise_script_service/mruby/src/class.c +26 -11
- data/ext/enterprise_script_service/mruby/src/codedump.c +4 -0
- data/ext/enterprise_script_service/mruby/src/debug.c +8 -5
- data/ext/enterprise_script_service/mruby/src/dump.c +3 -65
- data/ext/enterprise_script_service/mruby/src/error.c +57 -5
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -4
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +98 -21
- data/ext/enterprise_script_service/mruby/src/gc.c +10 -275
- data/ext/enterprise_script_service/mruby/src/hash.c +5 -6
- data/ext/enterprise_script_service/mruby/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/src/load.c +56 -30
- data/ext/enterprise_script_service/mruby/src/numeric.c +22 -10
- data/ext/enterprise_script_service/mruby/src/object.c +12 -4
- data/ext/enterprise_script_service/mruby/src/print.c +27 -3
- data/ext/enterprise_script_service/mruby/src/proc.c +21 -1
- data/ext/enterprise_script_service/mruby/src/state.c +34 -11
- data/ext/enterprise_script_service/mruby/src/string.c +69 -35
- data/ext/enterprise_script_service/mruby/src/symbol.c +12 -10
- data/ext/enterprise_script_service/mruby/src/vm.c +21 -30
- data/ext/enterprise_script_service/mruby/tasks/gitlab.rake +19 -22
- data/ext/enterprise_script_service/mruby/tasks/mrbgems.rake +1 -1
- data/ext/enterprise_script_service/mruby/tasks/toolchains/android.rake +46 -1
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +3 -3
- data/ext/enterprise_script_service/mruby/tasks/toolchains/openwrt.rake +6 -6
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +8 -8
- data/ext/enterprise_script_service/mruby/test/assert.rb +5 -4
- data/ext/enterprise_script_service/mruby/test/t/ensure.rb +8 -26
- data/ext/enterprise_script_service/mruby/test/t/exception.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +8 -24
- data/ext/enterprise_script_service/mruby/travis_config.rb +0 -14
- data/ext/enterprise_script_service/msgpack/.github/depends/boost.sh +56 -0
- data/ext/enterprise_script_service/msgpack/.github/workflows/coverage.yml +62 -0
- data/ext/enterprise_script_service/msgpack/.github/workflows/gha.yml +304 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +11 -0
- data/ext/enterprise_script_service/msgpack/CMakeLists.txt +82 -39
- data/ext/enterprise_script_service/msgpack/Files.cmake +22 -12
- data/ext/enterprise_script_service/msgpack/QUICKSTART-C.md +26 -29
- data/ext/enterprise_script_service/msgpack/README.md +3 -2
- data/ext/enterprise_script_service/msgpack/appveyor.yml +6 -2
- data/ext/enterprise_script_service/msgpack/ci/build_cmake.sh +3 -1
- data/ext/enterprise_script_service/msgpack/cmake/CodeCoverage.cmake +55 -0
- data/ext/enterprise_script_service/msgpack/codecov.yml +36 -0
- data/ext/enterprise_script_service/msgpack/example/CMakeLists.txt +9 -5
- data/ext/enterprise_script_service/msgpack/example/boost/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/example/c/CMakeLists.txt +17 -6
- data/ext/enterprise_script_service/msgpack/example/c/boundary.c +296 -0
- data/ext/enterprise_script_service/msgpack/example/c/jsonconv.c +419 -0
- data/ext/enterprise_script_service/msgpack/example/c/simple_c.c +1 -1
- data/ext/enterprise_script_service/msgpack/example/cpp03/CMakeLists.txt +3 -3
- data/ext/enterprise_script_service/msgpack/example/cpp11/CMakeLists.txt +2 -2
- data/ext/enterprise_script_service/msgpack/example/x3/CMakeLists.txt +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack.h +24 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/boost/optional.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp17/vector_byte.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/map.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_char.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_unsigned_char.hpp +8 -8
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +4 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/unpack.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +4 -4
- data/ext/enterprise_script_service/msgpack/make_file_list.sh +38 -11
- data/ext/enterprise_script_service/msgpack/src/vrefbuffer.c +6 -0
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +86 -64
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +4 -47
- data/ext/enterprise_script_service/msgpack/test/buffer_c.cpp +148 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/json.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +32 -27
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/object.cpp +4 -1
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +12 -8
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +30 -26
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +8 -4
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +16 -12
- data/ext/enterprise_script_service/msgpack/test/version.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +4 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +4 -0
- data/lib/script_core/version.rb +1 -1
- data/script_core.gemspec +1 -1
- metadata +23 -9
- data/ext/enterprise_script_service/msgpack/.travis.yml +0 -258
@@ -110,18 +110,22 @@
|
|
110
110
|
end
|
111
111
|
|
112
112
|
assert('File.realpath') do
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
113
|
+
dir = MRubyIOTestUtil.mkdtemp("mruby-io-test.XXXXXX")
|
114
|
+
begin
|
115
|
+
sep = File::ALT_SEPARATOR || File::SEPARATOR
|
116
|
+
relative_path = "#{File.basename(dir)}#{sep}realpath_test"
|
117
|
+
path = "#{File._getwd}#{sep}#{relative_path}"
|
118
|
+
File.open(path, "w"){}
|
119
|
+
assert_equal path, File.realpath(relative_path)
|
120
|
+
|
121
|
+
unless MRubyIOTestUtil.win?
|
122
|
+
path1 = File.realpath($mrbtest_io_rfname)
|
123
|
+
path2 = File.realpath($mrbtest_io_symlinkname)
|
124
|
+
assert_equal path1, path2
|
124
125
|
end
|
126
|
+
ensure
|
127
|
+
File.delete path rescue nil
|
128
|
+
MRubyIOTestUtil.rmdir dir
|
125
129
|
end
|
126
130
|
|
127
131
|
assert_raise(ArgumentError) { File.realpath("TO\0DO") }
|
@@ -129,7 +133,9 @@
|
|
129
133
|
|
130
134
|
assert("File.readlink") do
|
131
135
|
begin
|
132
|
-
|
136
|
+
exp = File.basename($mrbtest_io_rfname)
|
137
|
+
act = File.readlink($mrbtest_io_symlinkname)
|
138
|
+
assert_equal exp, act
|
133
139
|
rescue NotImplementedError => e
|
134
140
|
skip e.message
|
135
141
|
end
|
@@ -24,6 +24,10 @@ def assert_io_open(meth)
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
io2.close unless meth == :open
|
27
|
+
|
28
|
+
assert_raise(RuntimeError) { IO.__send__(meth, 1023) } # For Windows
|
29
|
+
assert_raise(RuntimeError) { IO.__send__(meth, 1 << 26) }
|
30
|
+
assert_raise(RuntimeError) { IO.__send__(meth, 1 << 32) } if (1 << 32).kind_of?(Integer)
|
27
31
|
end
|
28
32
|
end
|
29
33
|
|
@@ -564,6 +568,34 @@ def io._buf
|
|
564
568
|
end
|
565
569
|
end
|
566
570
|
|
571
|
+
assert('IO#pread') do
|
572
|
+
skip "IO#pread is not implemented on this configuration" unless MRubyIOTestUtil::MRB_WITH_IO_PREAD_PWRITE
|
573
|
+
|
574
|
+
IO.open(IO.sysopen($mrbtest_io_rfname, 'r'), 'r') do |io|
|
575
|
+
assert_equal $mrbtest_io_msg.byteslice(5, 8), io.pread(8, 5)
|
576
|
+
assert_equal 0, io.pos
|
577
|
+
assert_equal $mrbtest_io_msg.byteslice(1, 5), io.pread(5, 1)
|
578
|
+
assert_equal 0, io.pos
|
579
|
+
assert_raise(RuntimeError) { io.pread(20, -9) }
|
580
|
+
end
|
581
|
+
end
|
582
|
+
|
583
|
+
assert('IO#pwrite') do
|
584
|
+
skip "IO#pwrite is not implemented on this configuration" unless MRubyIOTestUtil::MRB_WITH_IO_PREAD_PWRITE
|
585
|
+
|
586
|
+
IO.open(IO.sysopen($mrbtest_io_wfname, 'w+'), 'w+') do |io|
|
587
|
+
assert_equal 6, io.pwrite("Warld!", 7)
|
588
|
+
assert_equal 0, io.pos
|
589
|
+
assert_equal 7, io.pwrite("Hello, ", 0)
|
590
|
+
assert_equal 0, io.pos
|
591
|
+
assert_equal "Hello, Warld!", io.read
|
592
|
+
assert_equal 6, io.pwrite("world!", 7)
|
593
|
+
assert_equal 13, io.pos
|
594
|
+
io.pos = 0
|
595
|
+
assert_equal "Hello, world!", io.read
|
596
|
+
end
|
597
|
+
end
|
598
|
+
|
567
599
|
assert('IO.pipe') do
|
568
600
|
begin
|
569
601
|
called = false
|
@@ -1,5 +1,7 @@
|
|
1
|
+
#include <mruby/common.h>
|
1
2
|
#include <sys/types.h>
|
2
3
|
#include <errno.h>
|
4
|
+
#include <string.h>
|
3
5
|
|
4
6
|
#if defined(_WIN32) || defined(_WIN64)
|
5
7
|
|
@@ -7,7 +9,6 @@
|
|
7
9
|
#include <io.h>
|
8
10
|
#include <fcntl.h>
|
9
11
|
#include <direct.h>
|
10
|
-
#include <string.h>
|
11
12
|
#include <stdlib.h>
|
12
13
|
#include <malloc.h>
|
13
14
|
|
@@ -18,12 +19,6 @@ typedef int mode_t;
|
|
18
19
|
#define open _open
|
19
20
|
#define close _close
|
20
21
|
|
21
|
-
#if defined(__MINGW64_VERSION_MAJOR)
|
22
|
-
# define MRB_MINGW64_VERSION (__MINGW64_VERSION_MAJOR * 1000 + __MINGW64_VERSION_MINOR)
|
23
|
-
#elif defined(__MINGW32_MAJOR_VERSION)
|
24
|
-
# define MRB_MINGW32_VERSION (__MINGW32_MAJOR_VERSION * 1000 + __MINGW32_MINOR_VERSION)
|
25
|
-
#endif
|
26
|
-
|
27
22
|
#if defined(_MSC_VER) || \
|
28
23
|
(defined(MRB_MINGW32_VERSION) && MRB_MINGW32_VERSION < 3021) || \
|
29
24
|
(defined(MRB_MINGW64_VERSION) && MRB_MINGW64_VERSION < 4000)
|
@@ -58,10 +53,11 @@ mkdtemp(char *temp)
|
|
58
53
|
#include <sys/socket.h>
|
59
54
|
#include <unistd.h>
|
60
55
|
#include <sys/un.h>
|
56
|
+
#include <fcntl.h>
|
57
|
+
#include <libgen.h>
|
61
58
|
#endif
|
62
59
|
|
63
60
|
#include <sys/stat.h>
|
64
|
-
#include <stdio.h>
|
65
61
|
#include <stdlib.h>
|
66
62
|
|
67
63
|
#include "mruby.h"
|
@@ -69,51 +65,55 @@ mkdtemp(char *temp)
|
|
69
65
|
#include "mruby/error.h"
|
70
66
|
#include "mruby/string.h"
|
71
67
|
#include "mruby/variable.h"
|
68
|
+
#include <mruby/ext/io.h>
|
72
69
|
|
73
70
|
static mrb_value
|
74
71
|
mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
|
75
72
|
{
|
76
|
-
|
77
|
-
|
78
|
-
char
|
79
|
-
char
|
73
|
+
#define GVNAME(n) "$mrbtest_io_" #n "name"
|
74
|
+
enum {IDX_READ, IDX_WRITE, IDX_LINK, IDX_SOCKET, IDX_COUNT};
|
75
|
+
const char *gvnames[] = {GVNAME(rf), GVNAME(wf), GVNAME(symlink), GVNAME(socket)};
|
76
|
+
char *fnames[IDX_COUNT];
|
77
|
+
int fds[IDX_COUNT];
|
80
78
|
char msg[] = "mruby io test\n";
|
81
79
|
mode_t mask;
|
82
|
-
int fd0, fd1;
|
83
80
|
FILE *fp;
|
84
|
-
|
81
|
+
int i;
|
85
82
|
#if !defined(_WIN32) && !defined(_WIN64)
|
86
|
-
int fd2, fd3;
|
87
83
|
struct sockaddr_un sun0;
|
88
84
|
#endif
|
89
85
|
|
90
|
-
|
91
|
-
fd0 = mkstemp(rfname);
|
92
|
-
fd1 = mkstemp(wfname);
|
93
|
-
if (fd0 == -1 || fd1 == -1) {
|
94
|
-
mrb_raise(mrb, E_RUNTIME_ERROR, "can't create temporary file");
|
95
|
-
return mrb_nil_value();
|
96
|
-
}
|
97
|
-
close(fd0);
|
98
|
-
close(fd1);
|
86
|
+
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_msg"), mrb_str_new_cstr(mrb, msg));
|
99
87
|
|
88
|
+
mask = umask(077);
|
89
|
+
for (i = 0; i < IDX_COUNT; i++) {
|
90
|
+
mrb_value fname = mrb_str_new_capa(mrb, 0);
|
100
91
|
#if !defined(_WIN32) && !defined(_WIN64)
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
92
|
+
/*
|
93
|
+
* Workaround for not being able to bind a socket to some file systems
|
94
|
+
* (e.g. vboxsf, NFS). [#4981]
|
95
|
+
*/
|
96
|
+
char *tmpdir = getenv("TMPDIR");
|
97
|
+
if (tmpdir && strlen(tmpdir) > 0) {
|
98
|
+
mrb_str_cat_cstr(mrb, fname, tmpdir);
|
99
|
+
if (*(RSTRING_END(fname)-1) != '/') mrb_str_cat_lit(mrb, fname, "/");
|
100
|
+
} else {
|
101
|
+
mrb_str_cat_lit(mrb, fname, "/tmp/");
|
102
|
+
}
|
107
103
|
#endif
|
104
|
+
mrb_str_cat_cstr(mrb, fname, gvnames[i]+1);
|
105
|
+
mrb_str_cat_cstr(mrb, fname, ".XXXXXXXX");
|
106
|
+
fnames[i] = RSTRING_PTR(fname);
|
107
|
+
fds[i] = mkstemp(fnames[i]);
|
108
|
+
if (fds[i] == -1) {
|
109
|
+
mrb_raise(mrb, E_RUNTIME_ERROR, "can't create temporary file");
|
110
|
+
}
|
111
|
+
close(fds[i]);
|
112
|
+
mrb_gv_set(mrb, mrb_intern_cstr(mrb, gvnames[i]), fname);
|
113
|
+
}
|
108
114
|
umask(mask);
|
109
115
|
|
110
|
-
|
111
|
-
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_wfname"), mrb_str_new_cstr(mrb, wfname));
|
112
|
-
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_symlinkname"), mrb_str_new_cstr(mrb, symlinkname));
|
113
|
-
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_socketname"), mrb_str_new_cstr(mrb, socketname));
|
114
|
-
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_msg"), mrb_str_new_cstr(mrb, msg));
|
115
|
-
|
116
|
-
fp = fopen(rfname, "wb");
|
116
|
+
fp = fopen(fnames[IDX_READ], "wb");
|
117
117
|
if (fp == NULL) {
|
118
118
|
mrb_raise(mrb, E_RUNTIME_ERROR, "can't open temporary file");
|
119
119
|
return mrb_nil_value();
|
@@ -121,7 +121,7 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
|
|
121
121
|
fputs(msg, fp);
|
122
122
|
fclose(fp);
|
123
123
|
|
124
|
-
fp = fopen(
|
124
|
+
fp = fopen(fnames[IDX_WRITE], "wb");
|
125
125
|
if (fp == NULL) {
|
126
126
|
mrb_raise(mrb, E_RUNTIME_ERROR, "can't open temporary file");
|
127
127
|
return mrb_nil_value();
|
@@ -129,29 +129,29 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
|
|
129
129
|
fclose(fp);
|
130
130
|
|
131
131
|
#if !defined(_WIN32) && !defined(_WIN64)
|
132
|
-
unlink(
|
133
|
-
|
134
|
-
if (symlink(rfname, symlinkname) == -1) {
|
132
|
+
unlink(fnames[IDX_LINK]);
|
133
|
+
if (symlink(basename(fnames[IDX_READ]), fnames[IDX_LINK]) == -1) {
|
135
134
|
mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a symbolic link");
|
136
135
|
}
|
137
136
|
|
138
|
-
unlink(
|
139
|
-
|
140
|
-
|
141
|
-
if (fd3 == -1) {
|
137
|
+
unlink(fnames[IDX_SOCKET]);
|
138
|
+
fds[IDX_SOCKET] = socket(AF_UNIX, SOCK_STREAM, 0);
|
139
|
+
if (fds[IDX_SOCKET] == -1) {
|
142
140
|
mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a socket");
|
143
141
|
}
|
144
142
|
sun0.sun_family = AF_UNIX;
|
145
|
-
|
146
|
-
|
143
|
+
strncpy(sun0.sun_path, fnames[IDX_SOCKET], sizeof(sun0.sun_path)-1);
|
144
|
+
sun0.sun_path[sizeof(sun0.sun_path)-1] = 0;
|
145
|
+
if (bind(fds[IDX_SOCKET], (struct sockaddr *)&sun0, sizeof(sun0)) == -1) {
|
147
146
|
mrb_raisef(mrb, E_RUNTIME_ERROR, "can't bind AF_UNIX socket to %s: %d",
|
148
147
|
sun0.sun_path,
|
149
148
|
errno);
|
150
149
|
}
|
151
|
-
close(
|
150
|
+
close(fds[IDX_SOCKET]);
|
152
151
|
#endif
|
153
152
|
|
154
153
|
return mrb_true_value();
|
154
|
+
#undef GVNAME
|
155
155
|
}
|
156
156
|
|
157
157
|
static mrb_value
|
@@ -210,7 +210,7 @@ mrb_io_test_rmdir(mrb_state *mrb, mrb_value klass)
|
|
210
210
|
return mrb_true_value();
|
211
211
|
}
|
212
212
|
|
213
|
-
mrb_value
|
213
|
+
static mrb_value
|
214
214
|
mrb_io_win_p(mrb_state *mrb, mrb_value klass)
|
215
215
|
{
|
216
216
|
#if defined(_WIN32) || defined(_WIN64)
|
@@ -224,6 +224,12 @@ mrb_io_win_p(mrb_state *mrb, mrb_value klass)
|
|
224
224
|
#endif
|
225
225
|
}
|
226
226
|
|
227
|
+
#ifdef MRB_WITH_IO_PREAD_PWRITE
|
228
|
+
# define MRB_WITH_IO_PREAD_PWRITE_ENABLED TRUE
|
229
|
+
#else
|
230
|
+
# define MRB_WITH_IO_PREAD_PWRITE_ENABLED FALSE
|
231
|
+
#endif
|
232
|
+
|
227
233
|
void
|
228
234
|
mrb_mruby_io_gem_test(mrb_state* mrb)
|
229
235
|
{
|
@@ -234,4 +240,6 @@ mrb_mruby_io_gem_test(mrb_state* mrb)
|
|
234
240
|
mrb_define_class_method(mrb, io_test, "mkdtemp", mrb_io_test_mkdtemp, MRB_ARGS_REQ(1));
|
235
241
|
mrb_define_class_method(mrb, io_test, "rmdir", mrb_io_test_rmdir, MRB_ARGS_REQ(1));
|
236
242
|
mrb_define_class_method(mrb, io_test, "win?", mrb_io_win_p, MRB_ARGS_NONE());
|
243
|
+
|
244
|
+
mrb_define_const(mrb, io_test, "MRB_WITH_IO_PREAD_PWRITE", mrb_bool_value(MRB_WITH_IO_PREAD_PWRITE_ENABLED));
|
237
245
|
}
|
@@ -139,31 +139,30 @@ mrb_local_variables(mrb_state *mrb, mrb_value self)
|
|
139
139
|
|
140
140
|
proc = mrb->c->ci[-1].proc;
|
141
141
|
|
142
|
-
if (MRB_PROC_CFUNC_P(proc)) {
|
142
|
+
if (proc == NULL || MRB_PROC_CFUNC_P(proc)) {
|
143
143
|
return mrb_ary_new(mrb);
|
144
144
|
}
|
145
145
|
vars = mrb_hash_new(mrb);
|
146
146
|
while (proc) {
|
147
147
|
if (MRB_PROC_CFUNC_P(proc)) break;
|
148
148
|
irep = proc->body.irep;
|
149
|
-
if (
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
149
|
+
if (irep->lv) {
|
150
|
+
for (i = 0; i + 1 < irep->nlocals; ++i) {
|
151
|
+
if (irep->lv[i].name) {
|
152
|
+
mrb_sym sym = irep->lv[i].name;
|
153
|
+
const char *name = mrb_sym_name(mrb, sym);
|
154
|
+
switch (name[0]) {
|
155
|
+
case '*': case '&':
|
156
|
+
break;
|
157
|
+
default:
|
158
|
+
mrb_hash_set(mrb, vars, mrb_symbol_value(sym), mrb_true_value());
|
159
|
+
break;
|
160
|
+
}
|
160
161
|
}
|
161
162
|
}
|
162
163
|
}
|
163
|
-
if (
|
164
|
+
if (MRB_PROC_SCOPE_P(proc)) break;
|
164
165
|
proc = proc->upper;
|
165
|
-
//if (MRB_PROC_SCOPE_P(proc)) break;
|
166
|
-
if (!proc->c) break;
|
167
166
|
}
|
168
167
|
|
169
168
|
return mrb_hash_keys(mrb, vars);
|
@@ -671,8 +670,7 @@ mrb_mod_s_nesting(mrb_state *mrb, mrb_value mod)
|
|
671
670
|
|
672
671
|
ary = mrb_ary_new(mrb);
|
673
672
|
proc = mrb->c->ci[-1].proc; /* callee proc */
|
674
|
-
|
675
|
-
while (proc) {
|
673
|
+
while (proc && !MRB_PROC_CFUNC_P(proc)) {
|
676
674
|
if (MRB_PROC_SCOPE_P(proc)) {
|
677
675
|
struct RClass *c2 = MRB_PROC_TARGET_CLASS(proc);
|
678
676
|
|
@@ -114,6 +114,15 @@ def foo
|
|
114
114
|
# Kernel#local_variables: 15.3.1.3.28
|
115
115
|
local_variables.sort
|
116
116
|
}.call(-1, -2)
|
117
|
+
|
118
|
+
a = Object.new
|
119
|
+
def a.hoge(vars, *, **)
|
120
|
+
Proc.new {
|
121
|
+
x, y = 1, 2
|
122
|
+
local_variables.sort
|
123
|
+
}
|
124
|
+
end
|
125
|
+
assert_equal([:vars, :x, :y]) { a.hoge(0).call }
|
117
126
|
end
|
118
127
|
|
119
128
|
assert('Kernel#define_singleton_method') do
|
@@ -110,7 +110,7 @@ method_eql(mrb_state *mrb, mrb_value self)
|
|
110
110
|
|
111
111
|
static mrb_value
|
112
112
|
mcall(mrb_state *mrb, mrb_value recv, mrb_value proc, mrb_value name, struct RClass *owner,
|
113
|
-
|
113
|
+
mrb_int argc, mrb_value *argv, mrb_value block)
|
114
114
|
{
|
115
115
|
mrb_value ret;
|
116
116
|
mrb_sym orig_mid = mrb->c->ci->mid;
|
@@ -101,18 +101,9 @@ mrb_obj_instance_exec(mrb_state *mrb, mrb_value self)
|
|
101
101
|
struct RClass *c;
|
102
102
|
|
103
103
|
mrb_get_args(mrb, "*&!", &argv, &argc, &blk);
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
case MRB_TT_FIXNUM:
|
108
|
-
#ifndef MRB_WITHOUT_FLOAT
|
109
|
-
case MRB_TT_FLOAT:
|
110
|
-
#endif
|
111
|
-
c = NULL;
|
112
|
-
break;
|
113
|
-
default:
|
114
|
-
c = mrb_class_ptr(mrb_singleton_class(mrb, self));
|
115
|
-
break;
|
104
|
+
c = mrb_singleton_class_ptr(mrb, self);
|
105
|
+
if (mrb->c->ci->acc < 0) {
|
106
|
+
return mrb_yield_with_class(mrb, blk, argc, argv, self, c);
|
116
107
|
}
|
117
108
|
mrb->c->ci->target_class = c;
|
118
109
|
return mrb_yield_cont(mrb, blk, self, argc, argv);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
** pack.c - Array#pack, String#unpack
|
3
3
|
*/
|
4
4
|
|
5
|
-
#include
|
5
|
+
#include <mruby.h>
|
6
6
|
#include "mruby/error.h"
|
7
7
|
#include "mruby/array.h"
|
8
8
|
#include "mruby/class.h"
|
@@ -13,7 +13,6 @@
|
|
13
13
|
#include <ctype.h>
|
14
14
|
#include <errno.h>
|
15
15
|
#include <limits.h>
|
16
|
-
#include <stdio.h>
|
17
16
|
#include <string.h>
|
18
17
|
|
19
18
|
struct tmpl {
|
@@ -213,6 +212,59 @@ pack_l(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, unsigned int fl
|
|
213
212
|
return 4;
|
214
213
|
}
|
215
214
|
|
215
|
+
#ifndef MRB_INT64
|
216
|
+
static void
|
217
|
+
u32tostr(char *buf, size_t len, uint32_t n)
|
218
|
+
{
|
219
|
+
#ifdef MRB_DISABLE_STDIO
|
220
|
+
char *bufend = buf + len;
|
221
|
+
char *p = bufend - 1;
|
222
|
+
|
223
|
+
if (len < 1) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
|
227
|
+
*p -- = '\0';
|
228
|
+
len --;
|
229
|
+
|
230
|
+
if (n > 0) {
|
231
|
+
for (; len > 0 && n > 0; len --, n /= 10) {
|
232
|
+
*p -- = '0' + (n % 10);
|
233
|
+
}
|
234
|
+
p ++;
|
235
|
+
}
|
236
|
+
else if (len > 0) {
|
237
|
+
*p = '0';
|
238
|
+
len --;
|
239
|
+
}
|
240
|
+
|
241
|
+
memmove(buf, p, bufend - p);
|
242
|
+
#else
|
243
|
+
snprintf(buf, len, "%" PRIu32, n);
|
244
|
+
#endif /* MRB_DISABLE_STDIO */
|
245
|
+
}
|
246
|
+
|
247
|
+
static void
|
248
|
+
i32tostr(char *buf, size_t len, int32_t n)
|
249
|
+
{
|
250
|
+
#ifdef MRB_DISABLE_STDIO
|
251
|
+
if (len < 1) {
|
252
|
+
return;
|
253
|
+
}
|
254
|
+
|
255
|
+
if (n < 0) {
|
256
|
+
*buf ++ = '-';
|
257
|
+
len --;
|
258
|
+
n = -n;
|
259
|
+
}
|
260
|
+
|
261
|
+
u32tostr(buf, len, (uint32_t)n);
|
262
|
+
#else
|
263
|
+
snprintf(buf, len, "%" PRId32, n);
|
264
|
+
#endif /* MRB_DISABLE_STDIO */
|
265
|
+
}
|
266
|
+
#endif /* MRB_INT64 */
|
267
|
+
|
216
268
|
static int
|
217
269
|
unpack_l(mrb_state *mrb, const unsigned char *src, int srclen, mrb_value ary, unsigned int flags)
|
218
270
|
{
|
@@ -237,16 +289,16 @@ unpack_l(mrb_state *mrb, const unsigned char *src, int srclen, mrb_value ary, un
|
|
237
289
|
int32_t sl = ul;
|
238
290
|
#ifndef MRB_INT64
|
239
291
|
if (!FIXABLE(sl)) {
|
240
|
-
|
241
|
-
|
292
|
+
i32tostr(msg, sizeof(msg), sl);
|
293
|
+
mrb_raisef(mrb, E_RANGE_ERROR, "cannot unpack to Fixnum: %s", msg);
|
242
294
|
}
|
243
295
|
#endif
|
244
296
|
n = sl;
|
245
297
|
} else {
|
246
298
|
#ifndef MRB_INT64
|
247
299
|
if (!POSFIXABLE(ul)) {
|
248
|
-
|
249
|
-
|
300
|
+
u32tostr(msg, sizeof(msg), ul);
|
301
|
+
mrb_raisef(mrb, E_RANGE_ERROR, "cannot unpack to Fixnum: %s", msg);
|
250
302
|
}
|
251
303
|
#endif
|
252
304
|
n = ul;
|
@@ -284,6 +336,57 @@ pack_q(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, unsigned int fl
|
|
284
336
|
return 8;
|
285
337
|
}
|
286
338
|
|
339
|
+
static void
|
340
|
+
u64tostr(char *buf, size_t len, uint64_t n)
|
341
|
+
{
|
342
|
+
#ifdef MRB_DISABLE_STDIO
|
343
|
+
char *bufend = buf + len;
|
344
|
+
char *p = bufend - 1;
|
345
|
+
|
346
|
+
if (len < 1) {
|
347
|
+
return;
|
348
|
+
}
|
349
|
+
|
350
|
+
*p -- = '\0';
|
351
|
+
len --;
|
352
|
+
|
353
|
+
if (n > 0) {
|
354
|
+
for (; len > 0 && n > 0; len --, n /= 10) {
|
355
|
+
*p -- = '0' + (n % 10);
|
356
|
+
}
|
357
|
+
p ++;
|
358
|
+
}
|
359
|
+
else if (len > 0) {
|
360
|
+
*p = '0';
|
361
|
+
len --;
|
362
|
+
}
|
363
|
+
|
364
|
+
memmove(buf, p, bufend - p);
|
365
|
+
#else
|
366
|
+
snprintf(buf, len, "%" PRIu64, n);
|
367
|
+
#endif /* MRB_DISABLE_STDIO */
|
368
|
+
}
|
369
|
+
|
370
|
+
static void
|
371
|
+
i64tostr(char *buf, size_t len, int64_t n)
|
372
|
+
{
|
373
|
+
#ifdef MRB_DISABLE_STDIO
|
374
|
+
if (len < 1) {
|
375
|
+
return;
|
376
|
+
}
|
377
|
+
|
378
|
+
if (n < 0) {
|
379
|
+
*buf ++ = '-';
|
380
|
+
len --;
|
381
|
+
n = -n;
|
382
|
+
}
|
383
|
+
|
384
|
+
u64tostr(buf, len, (uint64_t)n);
|
385
|
+
#else
|
386
|
+
snprintf(buf, len, "%" PRId64, n);
|
387
|
+
#endif /* MRB_DISABLE_STDIO */
|
388
|
+
}
|
389
|
+
|
287
390
|
static int
|
288
391
|
unpack_q(mrb_state *mrb, const unsigned char *src, int srclen, mrb_value ary, unsigned int flags)
|
289
392
|
{
|
@@ -307,14 +410,14 @@ unpack_q(mrb_state *mrb, const unsigned char *src, int srclen, mrb_value ary, un
|
|
307
410
|
if (flags & PACK_FLAG_SIGNED) {
|
308
411
|
int64_t sll = ull;
|
309
412
|
if (!FIXABLE(sll)) {
|
310
|
-
|
311
|
-
|
413
|
+
i64tostr(msg, sizeof(msg), sll);
|
414
|
+
mrb_raisef(mrb, E_RANGE_ERROR, "cannot unpack to Fixnum: %s", msg);
|
312
415
|
}
|
313
416
|
n = sll;
|
314
417
|
} else {
|
315
418
|
if (!POSFIXABLE(ull)) {
|
316
|
-
|
317
|
-
|
419
|
+
u64tostr(msg, sizeof(msg), ull);
|
420
|
+
mrb_raisef(mrb, E_RANGE_ERROR, "cannot unpack to Fixnum: %s", msg);
|
318
421
|
}
|
319
422
|
n = ull;
|
320
423
|
}
|