script_core 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/enterprise_script_service/libseccomp/.travis.yml +21 -7
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +22 -0
- data/ext/enterprise_script_service/libseccomp/CONTRIBUTING.md +37 -26
- data/ext/enterprise_script_service/libseccomp/CREDITS +8 -0
- data/ext/enterprise_script_service/libseccomp/README.md +3 -1
- data/ext/enterprise_script_service/libseccomp/configure.ac +13 -8
- data/ext/enterprise_script_service/libseccomp/doc/Makefile.am +6 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_api_get.3 +12 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_arch_add.3 +38 -6
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_attr_set.3 +53 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_export_bpf.3 +20 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_init.3 +9 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_load.3 +32 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_merge.3 +16 -2
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_alloc.3 +113 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_fd.3 +1 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_free.3 +1 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_id_valid.3 +1 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_receive.3 +1 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_respond.3 +1 -0
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_rule_add.3 +64 -3
- data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_syscall_priority.3 +18 -3
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +12 -0
- data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +116 -0
- data/ext/enterprise_script_service/libseccomp/src/.gitignore +2 -0
- data/ext/enterprise_script_service/libseccomp/src/Makefile.am +31 -17
- data/ext/enterprise_script_service/libseccomp/src/api.c +254 -58
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64.h +1 -9
- data/ext/enterprise_script_service/libseccomp/src/arch-arm.c +47 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-arm.h +1 -9
- data/ext/enterprise_script_service/libseccomp/src/arch-gperf-generate +40 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-mips.c +41 -4
- data/ext/enterprise_script_service/libseccomp/src/arch-mips.h +2 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64.c +41 -4
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64.h +3 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32.c +41 -4
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32.h +2 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc.h +1 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc64.c +3 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc64.h +29 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc.h +1 -9
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64.c +606 -8
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64.h +2 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-riscv64.c +31 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-riscv64.h +22 -0
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +171 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.h +1 -17
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +166 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.h +1 -20
- data/ext/enterprise_script_service/libseccomp/src/arch-syscall-dump.c +8 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-syscall-validate +359 -143
- data/ext/enterprise_script_service/libseccomp/src/arch-x32.c +36 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-x32.h +2 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +172 -10
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.h +1 -14
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64.h +1 -9
- data/ext/enterprise_script_service/libseccomp/src/arch.c +11 -3
- data/ext/enterprise_script_service/libseccomp/src/arch.h +7 -0
- data/ext/enterprise_script_service/libseccomp/src/db.c +268 -57
- data/ext/enterprise_script_service/libseccomp/src/db.h +16 -2
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +503 -148
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.h +2 -1
- data/ext/enterprise_script_service/libseccomp/src/gen_pfc.c +165 -37
- data/ext/enterprise_script_service/libseccomp/src/python/libseccomp.pxd +37 -1
- data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +295 -5
- data/ext/enterprise_script_service/libseccomp/src/syscalls.c +56 -0
- data/ext/enterprise_script_service/libseccomp/src/syscalls.csv +470 -0
- data/ext/enterprise_script_service/libseccomp/src/syscalls.h +62 -0
- data/ext/enterprise_script_service/libseccomp/src/syscalls.perf.template +82 -0
- data/ext/enterprise_script_service/libseccomp/src/system.c +196 -16
- data/ext/enterprise_script_service/libseccomp/src/system.h +68 -13
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +9 -2
- data/ext/enterprise_script_service/libseccomp/tests/06-sim-actions.tests +1 -1
- data/ext/enterprise_script_service/libseccomp/tests/11-basic-basic_errors.c +5 -5
- data/ext/enterprise_script_service/libseccomp/tests/13-basic-attrs.c +35 -1
- data/ext/enterprise_script_service/libseccomp/tests/13-basic-attrs.py +10 -1
- data/ext/enterprise_script_service/libseccomp/tests/15-basic-resolver.c +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/16-sim-arch_basic.c +12 -0
- data/ext/enterprise_script_service/libseccomp/tests/16-sim-arch_basic.py +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/{18-sim-basic_whitelist.c → 18-sim-basic_allowlist.c} +0 -0
- data/ext/enterprise_script_service/libseccomp/tests/{18-sim-basic_whitelist.py → 18-sim-basic_allowlist.py} +0 -0
- data/ext/enterprise_script_service/libseccomp/tests/18-sim-basic_allowlist.tests +32 -0
- data/ext/enterprise_script_service/libseccomp/tests/23-sim-arch_all_le_basic.c +3 -0
- data/ext/enterprise_script_service/libseccomp/tests/23-sim-arch_all_le_basic.py +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.c +3 -0
- data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.py +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.tests +33 -17
- data/ext/enterprise_script_service/libseccomp/tests/{34-sim-basic_blacklist.c → 34-sim-basic_denylist.c} +0 -0
- data/ext/enterprise_script_service/libseccomp/tests/{34-sim-basic_blacklist.py → 34-sim-basic_denylist.py} +0 -0
- data/ext/enterprise_script_service/libseccomp/tests/34-sim-basic_denylist.tests +32 -0
- data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.c +3 -0
- data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.py +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.tests +25 -25
- data/ext/enterprise_script_service/libseccomp/tests/39-basic-api_level.c +24 -3
- data/ext/enterprise_script_service/libseccomp/tests/39-basic-api_level.py +16 -1
- data/ext/enterprise_script_service/libseccomp/tests/47-live-kill_process.c +3 -3
- data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.c +112 -0
- data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.py +60 -0
- data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.c +156 -0
- data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.py +95 -0
- data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.tests +65 -0
- data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.c +128 -0
- data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.py +95 -0
- data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.c +134 -0
- data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.sh +46 -0
- data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.c +90 -0
- data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.py +65 -0
- data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.c +64 -0
- data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.py +46 -0
- data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.c +116 -0
- data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.py +61 -0
- data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.tests +11 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +31 -10
- data/ext/enterprise_script_service/libseccomp/tests/regression +6 -3
- data/ext/enterprise_script_service/libseccomp/tests/util.c +3 -3
- data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -1
- data/ext/enterprise_script_service/libseccomp/tools/scmp_arch_detect.c +3 -0
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_disasm.c +4 -2
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/libseccomp/tools/util.c +14 -12
- data/ext/enterprise_script_service/libseccomp/tools/util.h +7 -0
- data/ext/enterprise_script_service/mruby/.github/workflows/codeql-analysis.yml +51 -0
- data/ext/enterprise_script_service/mruby/Doxyfile +1 -1
- data/ext/enterprise_script_service/mruby/README.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/limitations.md +10 -10
- data/ext/enterprise_script_service/mruby/include/mruby.h +13 -0
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +0 -1
- data/ext/enterprise_script_service/mruby/include/mruby/proc.h +13 -8
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +25 -29
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +5 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +17 -10
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-inline-struct/test/inline.c +3 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +9 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +6 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +3 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +5 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +5 -10
- data/ext/enterprise_script_service/mruby/mrblib/00class.rb +10 -0
- data/ext/enterprise_script_service/mruby/src/array.c +14 -11
- data/ext/enterprise_script_service/mruby/src/class.c +22 -21
- data/ext/enterprise_script_service/mruby/src/error.c +1 -2
- data/ext/enterprise_script_service/mruby/src/etc.c +0 -1
- data/ext/enterprise_script_service/mruby/src/gc.c +5 -5
- data/ext/enterprise_script_service/mruby/src/hash.c +8 -15
- data/ext/enterprise_script_service/mruby/src/kernel.c +4 -7
- data/ext/enterprise_script_service/mruby/src/numeric.c +28 -60
- data/ext/enterprise_script_service/mruby/src/object.c +11 -1
- data/ext/enterprise_script_service/mruby/src/proc.c +7 -8
- data/ext/enterprise_script_service/mruby/src/range.c +4 -12
- data/ext/enterprise_script_service/mruby/src/string.c +24 -21
- data/ext/enterprise_script_service/mruby/src/symbol.c +1 -2
- data/ext/enterprise_script_service/mruby/src/vm.c +28 -24
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +7 -0
- data/lib/script_core/version.rb +1 -1
- metadata +45 -21
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +0 -559
- data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +0 -570
- data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +0 -562
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +0 -562
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +0 -562
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +0 -542
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +0 -559
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +0 -559
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +0 -642
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +0 -642
- data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +0 -558
- data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +0 -692
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +0 -559
- data/ext/enterprise_script_service/libseccomp/tests/18-sim-basic_whitelist.tests +0 -32
- data/ext/enterprise_script_service/libseccomp/tests/34-sim-basic_blacklist.tests +0 -32
@@ -160,9 +160,8 @@ set_backtrace(mrb_state *mrb, mrb_value exc, mrb_value backtrace)
|
|
160
160
|
static mrb_value
|
161
161
|
exc_set_backtrace(mrb_state *mrb, mrb_value exc)
|
162
162
|
{
|
163
|
-
mrb_value backtrace;
|
163
|
+
mrb_value backtrace = mrb_get_arg1(mrb);
|
164
164
|
|
165
|
-
mrb_get_args(mrb, "o", &backtrace);
|
166
165
|
set_backtrace(mrb, exc, backtrace);
|
167
166
|
return backtrace;
|
168
167
|
}
|
@@ -716,10 +716,10 @@ gc_mark_children(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
|
|
716
716
|
struct REnv *e = (struct REnv*)obj;
|
717
717
|
mrb_int i, len;
|
718
718
|
|
719
|
-
if (
|
719
|
+
if (MRB_ENV_ONSTACK_P(e) && e->cxt && e->cxt->fib) {
|
720
720
|
mrb_gc_mark(mrb, (struct RBasic*)e->cxt->fib);
|
721
721
|
}
|
722
|
-
len =
|
722
|
+
len = MRB_ENV_LEN(e);
|
723
723
|
for (i=0; i<len; i++) {
|
724
724
|
mrb_gc_mark_value(mrb, e->stack[i]);
|
725
725
|
}
|
@@ -820,7 +820,7 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
|
|
820
820
|
{
|
821
821
|
struct REnv *e = (struct REnv*)obj;
|
822
822
|
|
823
|
-
if (
|
823
|
+
if (MRB_ENV_ONSTACK_P(e)) {
|
824
824
|
/* cannot be freed */
|
825
825
|
e->stack = NULL;
|
826
826
|
break;
|
@@ -842,7 +842,7 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
|
|
842
842
|
while (ce <= ci) {
|
843
843
|
struct REnv *e = ci->env;
|
844
844
|
if (e && !mrb_object_dead_p(mrb, (struct RBasic*)e) &&
|
845
|
-
e->tt == MRB_TT_ENV &&
|
845
|
+
e->tt == MRB_TT_ENV && MRB_ENV_ONSTACK_P(e)) {
|
846
846
|
mrb_env_unshare(mrb, e);
|
847
847
|
}
|
848
848
|
ci--;
|
@@ -990,7 +990,7 @@ gc_gray_counts(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
|
|
990
990
|
break;
|
991
991
|
|
992
992
|
case MRB_TT_ENV:
|
993
|
-
children +=
|
993
|
+
children += MRB_ENV_LEN(obj);
|
994
994
|
break;
|
995
995
|
|
996
996
|
case MRB_TT_FIBER:
|
@@ -73,7 +73,7 @@ ht_hash_func(mrb_state *mrb, htable *t, mrb_value key)
|
|
73
73
|
|
74
74
|
default:
|
75
75
|
hv = mrb_funcall(mrb, key, "hash", 0);
|
76
|
-
h = (size_t)
|
76
|
+
h = (size_t)tt ^ (size_t)mrb_fixnum(hv);
|
77
77
|
break;
|
78
78
|
}
|
79
79
|
if (index && (index != t->index || capa != index->capa)) {
|
@@ -641,12 +641,11 @@ static mrb_value hash_default(mrb_state *mrb, mrb_value hash, mrb_value key);
|
|
641
641
|
static mrb_value
|
642
642
|
mrb_hash_init_copy(mrb_state *mrb, mrb_value self)
|
643
643
|
{
|
644
|
-
mrb_value orig;
|
644
|
+
mrb_value orig = mrb_get_arg1(mrb);
|
645
645
|
struct RHash* copy;
|
646
646
|
htable *orig_h;
|
647
647
|
mrb_value ifnone, vret;
|
648
648
|
|
649
|
-
mrb_get_args(mrb, "o", &orig);
|
650
649
|
if (mrb_obj_equal(mrb, self, orig)) return self;
|
651
650
|
if ((mrb_type(self) != mrb_type(orig)) || (mrb_obj_class(mrb, self) != mrb_obj_class(mrb, orig))) {
|
652
651
|
mrb_raise(mrb, E_TYPE_ERROR, "initialize_copy should take same class object");
|
@@ -828,9 +827,8 @@ mrb_hash_init(mrb_state *mrb, mrb_value hash)
|
|
828
827
|
static mrb_value
|
829
828
|
mrb_hash_aget(mrb_state *mrb, mrb_value self)
|
830
829
|
{
|
831
|
-
mrb_value key;
|
830
|
+
mrb_value key = mrb_get_arg1(mrb);
|
832
831
|
|
833
|
-
mrb_get_args(mrb, "o", &key);
|
834
832
|
return mrb_hash_get(mrb, self, key);
|
835
833
|
}
|
836
834
|
|
@@ -913,9 +911,8 @@ mrb_hash_default(mrb_state *mrb, mrb_value hash)
|
|
913
911
|
static mrb_value
|
914
912
|
mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
|
915
913
|
{
|
916
|
-
mrb_value ifnone;
|
914
|
+
mrb_value ifnone = mrb_get_arg1(mrb);
|
917
915
|
|
918
|
-
mrb_get_args(mrb, "o", &ifnone);
|
919
916
|
mrb_hash_modify(mrb, hash);
|
920
917
|
mrb_iv_set(mrb, hash, mrb_intern_lit(mrb, "ifnone"), ifnone);
|
921
918
|
RHASH(hash)->flags &= ~MRB_HASH_PROC_DEFAULT;
|
@@ -969,9 +966,8 @@ mrb_hash_default_proc(mrb_state *mrb, mrb_value hash)
|
|
969
966
|
static mrb_value
|
970
967
|
mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
|
971
968
|
{
|
972
|
-
mrb_value ifnone;
|
969
|
+
mrb_value ifnone = mrb_get_arg1(mrb);
|
973
970
|
|
974
|
-
mrb_get_args(mrb, "o", &ifnone);
|
975
971
|
mrb_hash_modify(mrb, hash);
|
976
972
|
mrb_iv_set(mrb, hash, mrb_intern_lit(mrb, "ifnone"), ifnone);
|
977
973
|
if (!mrb_nil_p(ifnone)) {
|
@@ -1003,9 +999,8 @@ mrb_hash_delete_key(mrb_state *mrb, mrb_value hash, mrb_value key)
|
|
1003
999
|
static mrb_value
|
1004
1000
|
mrb_hash_delete(mrb_state *mrb, mrb_value self)
|
1005
1001
|
{
|
1006
|
-
mrb_value key;
|
1002
|
+
mrb_value key = mrb_get_arg1(mrb);
|
1007
1003
|
|
1008
|
-
mrb_get_args(mrb, "o", &key);
|
1009
1004
|
mrb_hash_modify(mrb, self);
|
1010
1005
|
return mrb_hash_delete_key(mrb, self, key);
|
1011
1006
|
}
|
@@ -1288,10 +1283,9 @@ mrb_hash_key_p(mrb_state *mrb, mrb_value hash, mrb_value key)
|
|
1288
1283
|
static mrb_value
|
1289
1284
|
mrb_hash_has_key(mrb_state *mrb, mrb_value hash)
|
1290
1285
|
{
|
1291
|
-
mrb_value key;
|
1286
|
+
mrb_value key = mrb_get_arg1(mrb);
|
1292
1287
|
mrb_bool key_p;
|
1293
1288
|
|
1294
|
-
mrb_get_args(mrb, "o", &key);
|
1295
1289
|
key_p = mrb_hash_key_p(mrb, hash, key);
|
1296
1290
|
return mrb_bool_value(key_p);
|
1297
1291
|
}
|
@@ -1331,10 +1325,9 @@ hash_has_value_i(mrb_state *mrb, mrb_value key, mrb_value val, void *p)
|
|
1331
1325
|
static mrb_value
|
1332
1326
|
mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
|
1333
1327
|
{
|
1334
|
-
mrb_value val;
|
1328
|
+
mrb_value val = mrb_get_arg1(mrb);
|
1335
1329
|
struct has_v_arg arg;
|
1336
1330
|
|
1337
|
-
mrb_get_args(mrb, "o", &val);
|
1338
1331
|
arg.found = FALSE;
|
1339
1332
|
arg.val = val;
|
1340
1333
|
ht_foreach(mrb, RHASH_TBL(hash), hash_has_value_i, &arg);
|
@@ -71,9 +71,8 @@ mrb_obj_inspect(mrb_state *mrb, mrb_value obj)
|
|
71
71
|
static mrb_value
|
72
72
|
mrb_equal_m(mrb_state *mrb, mrb_value self)
|
73
73
|
{
|
74
|
-
mrb_value arg;
|
74
|
+
mrb_value arg = mrb_get_arg1(mrb);
|
75
75
|
|
76
|
-
mrb_get_args(mrb, "o", &arg);
|
77
76
|
return mrb_bool_value(mrb_equal(mrb, self, arg));
|
78
77
|
}
|
79
78
|
|
@@ -161,7 +160,7 @@ mrb_f_block_given_p_m(mrb_state *mrb, mrb_value self)
|
|
161
160
|
/* use saved block arg position */
|
162
161
|
bidx = MRB_ENV_BIDX(e);
|
163
162
|
/* bidx may be useless (e.g. define_method) */
|
164
|
-
if (bidx >=
|
163
|
+
if (bidx >= MRB_ENV_LEN(e))
|
165
164
|
return mrb_false_value();
|
166
165
|
bp = &e->stack[bidx];
|
167
166
|
}
|
@@ -471,9 +470,8 @@ mrb_obj_hash(mrb_state *mrb, mrb_value self)
|
|
471
470
|
static mrb_value
|
472
471
|
mrb_obj_init_copy(mrb_state *mrb, mrb_value self)
|
473
472
|
{
|
474
|
-
mrb_value orig;
|
473
|
+
mrb_value orig = mrb_get_arg1(mrb);
|
475
474
|
|
476
|
-
mrb_get_args(mrb, "o", &orig);
|
477
475
|
if (mrb_obj_equal(mrb, self, orig)) return self;
|
478
476
|
if ((mrb_type(self) != mrb_type(orig)) || (mrb_obj_class(mrb, self) != mrb_obj_class(mrb, orig))) {
|
479
477
|
mrb_raise(mrb, E_TYPE_ERROR, "initialize_copy should take same class object");
|
@@ -744,12 +742,11 @@ obj_respond_to(mrb_state *mrb, mrb_value self)
|
|
744
742
|
static mrb_value
|
745
743
|
mrb_obj_ceqq(mrb_state *mrb, mrb_value self)
|
746
744
|
{
|
747
|
-
mrb_value v;
|
745
|
+
mrb_value v = mrb_get_arg1(mrb);
|
748
746
|
mrb_int i, len;
|
749
747
|
mrb_sym eqq = mrb_intern_lit(mrb, "===");
|
750
748
|
mrb_value ary = mrb_ary_splat(mrb, self);
|
751
749
|
|
752
|
-
mrb_get_args(mrb, "o", &v);
|
753
750
|
len = RARRAY_LEN(ary);
|
754
751
|
for (i=0; i<len; i++) {
|
755
752
|
mrb_value c = mrb_funcall_argv(mrb, mrb_ary_entry(ary, i), eqq, 1, &v);
|
@@ -67,12 +67,11 @@ mrb_int_value(mrb_state *mrb, mrb_float f)
|
|
67
67
|
static mrb_value
|
68
68
|
integral_pow(mrb_state *mrb, mrb_value x)
|
69
69
|
{
|
70
|
-
mrb_value y;
|
70
|
+
mrb_value y = mrb_get_arg1(mrb);
|
71
71
|
#ifndef MRB_WITHOUT_FLOAT
|
72
72
|
mrb_float d;
|
73
73
|
#endif
|
74
74
|
|
75
|
-
mrb_get_args(mrb, "o", &y);
|
76
75
|
if (mrb_fixnum_p(x) && mrb_fixnum_p(y)) {
|
77
76
|
/* try ipow() */
|
78
77
|
mrb_int base = mrb_fixnum(x);
|
@@ -116,9 +115,8 @@ static mrb_value
|
|
116
115
|
integral_idiv(mrb_state *mrb, mrb_value x)
|
117
116
|
{
|
118
117
|
#ifdef MRB_WITHOUT_FLOAT
|
119
|
-
mrb_value y;
|
118
|
+
mrb_value y = mrb_get_arg1(mrb);
|
120
119
|
|
121
|
-
mrb_get_args(mrb, "o", &y);
|
122
120
|
if (!mrb_fixnum_p(y)) {
|
123
121
|
mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
|
124
122
|
}
|
@@ -154,9 +152,8 @@ static mrb_value
|
|
154
152
|
integral_div(mrb_state *mrb, mrb_value x)
|
155
153
|
{
|
156
154
|
#ifdef MRB_WITHOUT_FLOAT
|
157
|
-
mrb_value y;
|
155
|
+
mrb_value y = mrb_get_arg1(mrb);
|
158
156
|
|
159
|
-
mrb_get_args(mrb, "o", &y);
|
160
157
|
if (!mrb_fixnum_p(y)) {
|
161
158
|
mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value");
|
162
159
|
}
|
@@ -271,9 +268,8 @@ flo_to_s(mrb_state *mrb, mrb_value flt)
|
|
271
268
|
static mrb_value
|
272
269
|
flo_minus(mrb_state *mrb, mrb_value x)
|
273
270
|
{
|
274
|
-
mrb_value y;
|
271
|
+
mrb_value y = mrb_get_arg1(mrb);
|
275
272
|
|
276
|
-
mrb_get_args(mrb, "o", &y);
|
277
273
|
return mrb_float_value(mrb, mrb_float(x) - mrb_to_flo(mrb, y));
|
278
274
|
}
|
279
275
|
|
@@ -289,9 +285,8 @@ flo_minus(mrb_state *mrb, mrb_value x)
|
|
289
285
|
static mrb_value
|
290
286
|
flo_mul(mrb_state *mrb, mrb_value x)
|
291
287
|
{
|
292
|
-
mrb_value y;
|
288
|
+
mrb_value y = mrb_get_arg1(mrb);
|
293
289
|
|
294
|
-
mrb_get_args(mrb, "o", &y);
|
295
290
|
return mrb_float_value(mrb, mrb_float(x) * mrb_to_flo(mrb, y));
|
296
291
|
}
|
297
292
|
|
@@ -351,11 +346,9 @@ flodivmod(mrb_state *mrb, double x, double y, mrb_float *divp, mrb_float *modp)
|
|
351
346
|
static mrb_value
|
352
347
|
flo_mod(mrb_state *mrb, mrb_value x)
|
353
348
|
{
|
354
|
-
mrb_value y;
|
349
|
+
mrb_value y = mrb_get_arg1(mrb);
|
355
350
|
mrb_float mod;
|
356
351
|
|
357
|
-
mrb_get_args(mrb, "o", &y);
|
358
|
-
|
359
352
|
flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), 0, &mod);
|
360
353
|
return mrb_float_value(mrb, mod);
|
361
354
|
}
|
@@ -376,9 +369,8 @@ flo_mod(mrb_state *mrb, mrb_value x)
|
|
376
369
|
static mrb_value
|
377
370
|
fix_eql(mrb_state *mrb, mrb_value x)
|
378
371
|
{
|
379
|
-
mrb_value y;
|
372
|
+
mrb_value y = mrb_get_arg1(mrb);
|
380
373
|
|
381
|
-
mrb_get_args(mrb, "o", &y);
|
382
374
|
if (!mrb_fixnum_p(y)) return mrb_false_value();
|
383
375
|
return mrb_bool_value(mrb_fixnum(x) == mrb_fixnum(y));
|
384
376
|
}
|
@@ -387,9 +379,8 @@ fix_eql(mrb_state *mrb, mrb_value x)
|
|
387
379
|
static mrb_value
|
388
380
|
flo_eql(mrb_state *mrb, mrb_value x)
|
389
381
|
{
|
390
|
-
mrb_value y;
|
382
|
+
mrb_value y = mrb_get_arg1(mrb);
|
391
383
|
|
392
|
-
mrb_get_args(mrb, "o", &y);
|
393
384
|
if (!mrb_float_p(y)) return mrb_false_value();
|
394
385
|
return mrb_bool_value(mrb_float(x) == mrb_float(y));
|
395
386
|
}
|
@@ -410,8 +401,7 @@ flo_eql(mrb_state *mrb, mrb_value x)
|
|
410
401
|
static mrb_value
|
411
402
|
flo_eq(mrb_state *mrb, mrb_value x)
|
412
403
|
{
|
413
|
-
mrb_value y;
|
414
|
-
mrb_get_args(mrb, "o", &y);
|
404
|
+
mrb_value y = mrb_get_arg1(mrb);
|
415
405
|
|
416
406
|
switch (mrb_type(y)) {
|
417
407
|
case MRB_TT_FIXNUM:
|
@@ -429,7 +419,6 @@ value_int64(mrb_state *mrb, mrb_value x)
|
|
429
419
|
switch (mrb_type(x)) {
|
430
420
|
case MRB_TT_FIXNUM:
|
431
421
|
return (int64_t)mrb_fixnum(x);
|
432
|
-
break;
|
433
422
|
case MRB_TT_FLOAT:
|
434
423
|
return (int64_t)mrb_float(x);
|
435
424
|
default:
|
@@ -460,9 +449,8 @@ flo_rev(mrb_state *mrb, mrb_value x)
|
|
460
449
|
static mrb_value
|
461
450
|
flo_and(mrb_state *mrb, mrb_value x)
|
462
451
|
{
|
463
|
-
mrb_value y;
|
452
|
+
mrb_value y = mrb_get_arg1(mrb);
|
464
453
|
int64_t v1, v2;
|
465
|
-
mrb_get_args(mrb, "o", &y);
|
466
454
|
|
467
455
|
v1 = (int64_t)mrb_float(x);
|
468
456
|
v2 = value_int64(mrb, y);
|
@@ -472,9 +460,8 @@ flo_and(mrb_state *mrb, mrb_value x)
|
|
472
460
|
static mrb_value
|
473
461
|
flo_or(mrb_state *mrb, mrb_value x)
|
474
462
|
{
|
475
|
-
mrb_value y;
|
463
|
+
mrb_value y = mrb_get_arg1(mrb);
|
476
464
|
int64_t v1, v2;
|
477
|
-
mrb_get_args(mrb, "o", &y);
|
478
465
|
|
479
466
|
v1 = (int64_t)mrb_float(x);
|
480
467
|
v2 = value_int64(mrb, y);
|
@@ -484,9 +471,8 @@ flo_or(mrb_state *mrb, mrb_value x)
|
|
484
471
|
static mrb_value
|
485
472
|
flo_xor(mrb_state *mrb, mrb_value x)
|
486
473
|
{
|
487
|
-
mrb_value y;
|
474
|
+
mrb_value y = mrb_get_arg1(mrb);
|
488
475
|
int64_t v1, v2;
|
489
|
-
mrb_get_args(mrb, "o", &y);
|
490
476
|
|
491
477
|
v1 = (int64_t)mrb_float(x);
|
492
478
|
v2 = value_int64(mrb, y);
|
@@ -847,9 +833,8 @@ mrb_num_mul(mrb_state *mrb, mrb_value x, mrb_value y)
|
|
847
833
|
static mrb_value
|
848
834
|
fix_mul(mrb_state *mrb, mrb_value x)
|
849
835
|
{
|
850
|
-
mrb_value y;
|
836
|
+
mrb_value y = mrb_get_arg1(mrb);
|
851
837
|
|
852
|
-
mrb_get_args(mrb, "o", &y);
|
853
838
|
return fixnum_mul(mrb, x, y);
|
854
839
|
}
|
855
840
|
|
@@ -894,10 +879,9 @@ fixdivmod(mrb_state *mrb, mrb_int x, mrb_int y, mrb_int *divp, mrb_int *modp)
|
|
894
879
|
static mrb_value
|
895
880
|
fix_mod(mrb_state *mrb, mrb_value x)
|
896
881
|
{
|
897
|
-
mrb_value y;
|
882
|
+
mrb_value y = mrb_get_arg1(mrb);
|
898
883
|
mrb_int a, b;
|
899
884
|
|
900
|
-
mrb_get_args(mrb, "o", &y);
|
901
885
|
a = mrb_fixnum(x);
|
902
886
|
if (mrb_fixnum_p(y) && a != MRB_INT_MIN && (b=mrb_fixnum(y)) != MRB_INT_MIN) {
|
903
887
|
mrb_int mod;
|
@@ -936,9 +920,7 @@ fix_mod(mrb_state *mrb, mrb_value x)
|
|
936
920
|
static mrb_value
|
937
921
|
fix_divmod(mrb_state *mrb, mrb_value x)
|
938
922
|
{
|
939
|
-
mrb_value y;
|
940
|
-
|
941
|
-
mrb_get_args(mrb, "o", &y);
|
923
|
+
mrb_value y = mrb_get_arg1(mrb);
|
942
924
|
|
943
925
|
if (mrb_fixnum_p(y)) {
|
944
926
|
mrb_int div, mod;
|
@@ -975,12 +957,10 @@ fix_divmod(mrb_state *mrb, mrb_value x)
|
|
975
957
|
static mrb_value
|
976
958
|
flo_divmod(mrb_state *mrb, mrb_value x)
|
977
959
|
{
|
978
|
-
mrb_value y;
|
960
|
+
mrb_value y = mrb_get_arg1(mrb);
|
979
961
|
mrb_float div, mod;
|
980
962
|
mrb_value a, b;
|
981
963
|
|
982
|
-
mrb_get_args(mrb, "o", &y);
|
983
|
-
|
984
964
|
flodivmod(mrb, mrb_float(x), mrb_to_flo(mrb, y), &div, &mod);
|
985
965
|
a = mrb_int_value(mrb, div);
|
986
966
|
b = mrb_float_value(mrb, mod);
|
@@ -1003,9 +983,8 @@ flo_divmod(mrb_state *mrb, mrb_value x)
|
|
1003
983
|
static mrb_value
|
1004
984
|
fix_equal(mrb_state *mrb, mrb_value x)
|
1005
985
|
{
|
1006
|
-
mrb_value y;
|
986
|
+
mrb_value y = mrb_get_arg1(mrb);
|
1007
987
|
|
1008
|
-
mrb_get_args(mrb, "o", &y);
|
1009
988
|
switch (mrb_type(y)) {
|
1010
989
|
case MRB_TT_FIXNUM:
|
1011
990
|
return mrb_bool_value(mrb_fixnum(x) == mrb_fixnum(y));
|
@@ -1062,9 +1041,8 @@ static mrb_value flo_xor(mrb_state *mrb, mrb_value x);
|
|
1062
1041
|
static mrb_value
|
1063
1042
|
fix_and(mrb_state *mrb, mrb_value x)
|
1064
1043
|
{
|
1065
|
-
mrb_value y;
|
1044
|
+
mrb_value y = mrb_get_arg1(mrb);
|
1066
1045
|
|
1067
|
-
mrb_get_args(mrb, "o", &y);
|
1068
1046
|
bit_op(x, y, and, &);
|
1069
1047
|
}
|
1070
1048
|
|
@@ -1079,9 +1057,8 @@ fix_and(mrb_state *mrb, mrb_value x)
|
|
1079
1057
|
static mrb_value
|
1080
1058
|
fix_or(mrb_state *mrb, mrb_value x)
|
1081
1059
|
{
|
1082
|
-
mrb_value y;
|
1060
|
+
mrb_value y = mrb_get_arg1(mrb);
|
1083
1061
|
|
1084
|
-
mrb_get_args(mrb, "o", &y);
|
1085
1062
|
bit_op(x, y, or, |);
|
1086
1063
|
}
|
1087
1064
|
|
@@ -1096,9 +1073,8 @@ fix_or(mrb_state *mrb, mrb_value x)
|
|
1096
1073
|
static mrb_value
|
1097
1074
|
fix_xor(mrb_state *mrb, mrb_value x)
|
1098
1075
|
{
|
1099
|
-
mrb_value y;
|
1076
|
+
mrb_value y = mrb_get_arg1(mrb);
|
1100
1077
|
|
1101
|
-
mrb_get_args(mrb, "o", &y);
|
1102
1078
|
bit_op(x, y, or, ^);
|
1103
1079
|
}
|
1104
1080
|
|
@@ -1320,9 +1296,8 @@ mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y)
|
|
1320
1296
|
static mrb_value
|
1321
1297
|
fix_plus(mrb_state *mrb, mrb_value self)
|
1322
1298
|
{
|
1323
|
-
mrb_value other;
|
1299
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1324
1300
|
|
1325
|
-
mrb_get_args(mrb, "o", &other);
|
1326
1301
|
return fixnum_plus(mrb, self, other);
|
1327
1302
|
}
|
1328
1303
|
|
@@ -1378,9 +1353,8 @@ mrb_num_minus(mrb_state *mrb, mrb_value x, mrb_value y)
|
|
1378
1353
|
static mrb_value
|
1379
1354
|
fix_minus(mrb_state *mrb, mrb_value self)
|
1380
1355
|
{
|
1381
|
-
mrb_value other;
|
1356
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1382
1357
|
|
1383
|
-
mrb_get_args(mrb, "o", &other);
|
1384
1358
|
return fixnum_minus(mrb, self, other);
|
1385
1359
|
}
|
1386
1360
|
|
@@ -1497,10 +1471,9 @@ cmpnum(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
|
1497
1471
|
static mrb_value
|
1498
1472
|
integral_cmp(mrb_state *mrb, mrb_value self)
|
1499
1473
|
{
|
1500
|
-
mrb_value other;
|
1474
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1501
1475
|
mrb_int n;
|
1502
1476
|
|
1503
|
-
mrb_get_args(mrb, "o", &other);
|
1504
1477
|
n = cmpnum(mrb, self, other);
|
1505
1478
|
if (n == -2) return mrb_nil_value();
|
1506
1479
|
return mrb_fixnum_value(n);
|
@@ -1515,10 +1488,9 @@ cmperr(mrb_state *mrb, mrb_value v1, mrb_value v2)
|
|
1515
1488
|
static mrb_value
|
1516
1489
|
integral_lt(mrb_state *mrb, mrb_value self)
|
1517
1490
|
{
|
1518
|
-
mrb_value other;
|
1491
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1519
1492
|
mrb_int n;
|
1520
1493
|
|
1521
|
-
mrb_get_args(mrb, "o", &other);
|
1522
1494
|
n = cmpnum(mrb, self, other);
|
1523
1495
|
if (n == -2) cmperr(mrb, self, other);
|
1524
1496
|
if (n < 0) return mrb_true_value();
|
@@ -1528,10 +1500,9 @@ integral_lt(mrb_state *mrb, mrb_value self)
|
|
1528
1500
|
static mrb_value
|
1529
1501
|
integral_le(mrb_state *mrb, mrb_value self)
|
1530
1502
|
{
|
1531
|
-
mrb_value other;
|
1503
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1532
1504
|
mrb_int n;
|
1533
1505
|
|
1534
|
-
mrb_get_args(mrb, "o", &other);
|
1535
1506
|
n = cmpnum(mrb, self, other);
|
1536
1507
|
if (n == -2) cmperr(mrb, self, other);
|
1537
1508
|
if (n <= 0) return mrb_true_value();
|
@@ -1541,10 +1512,9 @@ integral_le(mrb_state *mrb, mrb_value self)
|
|
1541
1512
|
static mrb_value
|
1542
1513
|
integral_gt(mrb_state *mrb, mrb_value self)
|
1543
1514
|
{
|
1544
|
-
mrb_value other;
|
1515
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1545
1516
|
mrb_int n;
|
1546
1517
|
|
1547
|
-
mrb_get_args(mrb, "o", &other);
|
1548
1518
|
n = cmpnum(mrb, self, other);
|
1549
1519
|
if (n == -2) cmperr(mrb, self, other);
|
1550
1520
|
if (n > 0) return mrb_true_value();
|
@@ -1554,10 +1524,9 @@ integral_gt(mrb_state *mrb, mrb_value self)
|
|
1554
1524
|
static mrb_value
|
1555
1525
|
integral_ge(mrb_state *mrb, mrb_value self)
|
1556
1526
|
{
|
1557
|
-
mrb_value other;
|
1527
|
+
mrb_value other = mrb_get_arg1(mrb);
|
1558
1528
|
mrb_int n;
|
1559
1529
|
|
1560
|
-
mrb_get_args(mrb, "o", &other);
|
1561
1530
|
n = cmpnum(mrb, self, other);
|
1562
1531
|
if (n == -2) cmperr(mrb, self, other);
|
1563
1532
|
if (n >= 0) return mrb_true_value();
|
@@ -1609,9 +1578,8 @@ num_infinite_p(mrb_state *mrb, mrb_value self)
|
|
1609
1578
|
static mrb_value
|
1610
1579
|
flo_plus(mrb_state *mrb, mrb_value x)
|
1611
1580
|
{
|
1612
|
-
mrb_value y;
|
1581
|
+
mrb_value y = mrb_get_arg1(mrb);
|
1613
1582
|
|
1614
|
-
mrb_get_args(mrb, "o", &y);
|
1615
1583
|
return mrb_float_value(mrb, mrb_float(x) + mrb_to_flo(mrb, y));
|
1616
1584
|
}
|
1617
1585
|
#endif
|