debase-ruby_core_source 3.2.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/addr2line.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/builtin.h +117 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/list/list.h +789 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/str/str.h +17 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/constant.h +53 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h +179 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/debug_counter.h +426 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/dln.h +31 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/eval_intern.h +339 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/hrtime.h +227 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id.h +299 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id_table.h +39 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns.inc +249 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns_info.inc +9159 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/array.h +162 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/basic_operators.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bignum.h +244 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bits.h +564 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/class.h +221 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cmdlineopt.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compar.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compile.h +35 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cont.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/encoding.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/error.h +191 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/eval.h +32 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/fixnum.h +184 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/gc.h +333 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/hash.h +216 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/imemo.h +241 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/inits.h +50 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h +38 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/load.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/missing.h +18 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/numeric.h +273 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/object.h +59 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h +25 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/proc.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/process.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/ractor.h +6 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/random.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/rational.h +71 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/re.h +28 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/sanitizers.h +186 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/signal.h +21 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/string.h +145 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/struct.h +152 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/symbol.h +42 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/thread.h +61 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/time.h +34 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/transcode.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/variable.h +88 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/vm.h +124 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal.h +112 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/iseq.h +334 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/known_errors.inc +791 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/method.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h +514 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node_name.inc +210 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optunifs.inc +43 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/parse.h +230 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/probes_helper.h +42 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ractor_core.h +387 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regenc.h +254 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regint.h +996 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regparse.h +370 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h +5 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit.h +103 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit_c.h +165 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_atomic.h +23 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/shape.h +232 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/symbol.h +119 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_none.h +20 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_pthread.h +128 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/thread_win32.h +63 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/timev.h +58 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/variable.h +30 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/version.h +65 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm.inc +5497 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_callinfo.h +574 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_core.h +2107 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_debug.h +122 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_exec.h +198 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_insnhelper.h +274 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_opts.h +72 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_sync.h +137 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vmtc.inc +243 -0
- data/lib/debase/ruby_core_source/ruby-3.3.0-preview1/yjit.h +72 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +116 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#ifndef INTERNAL_OBJECT_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_OBJECT_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Object.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
|
|
13
|
+
/* object.c */
|
|
14
|
+
VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
|
|
15
|
+
NORETURN(void rb_undefined_alloc(VALUE klass));
|
|
16
|
+
double rb_num_to_dbl(VALUE val);
|
|
17
|
+
VALUE rb_obj_dig(int argc, VALUE *argv, VALUE self, VALUE notfound);
|
|
18
|
+
VALUE rb_immutable_obj_clone(int, VALUE *, VALUE);
|
|
19
|
+
VALUE rb_check_convert_type_with_id(VALUE,int,const char*,ID);
|
|
20
|
+
int rb_bool_expected(VALUE, const char *, int raise);
|
|
21
|
+
static inline void RBASIC_CLEAR_CLASS(VALUE obj);
|
|
22
|
+
static inline void RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass);
|
|
23
|
+
static inline void RBASIC_SET_CLASS(VALUE obj, VALUE klass);
|
|
24
|
+
|
|
25
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
26
|
+
/* object.c (export) */
|
|
27
|
+
int rb_opts_exception_p(VALUE opts, int default_value);
|
|
28
|
+
RUBY_SYMBOL_EXPORT_END
|
|
29
|
+
|
|
30
|
+
CONSTFUNC(VALUE rb_obj_equal(VALUE obj1, VALUE obj2));
|
|
31
|
+
CONSTFUNC(VALUE rb_obj_not(VALUE obj));
|
|
32
|
+
VALUE rb_obj_not_equal(VALUE obj1, VALUE obj2);
|
|
33
|
+
void rb_obj_copy_ivar(VALUE dest, VALUE obj);
|
|
34
|
+
VALUE rb_false(VALUE obj);
|
|
35
|
+
VALUE rb_convert_type_with_id(VALUE v, int t, const char* nam, ID mid);
|
|
36
|
+
VALUE rb_obj_size(VALUE self, VALUE args, VALUE obj);
|
|
37
|
+
VALUE rb_get_freeze_opt(int argc, VALUE *argv);
|
|
38
|
+
|
|
39
|
+
static inline void
|
|
40
|
+
RBASIC_SET_CLASS_RAW(VALUE obj, VALUE klass)
|
|
41
|
+
{
|
|
42
|
+
const VALUE *ptr = &RBASIC(obj)->klass;
|
|
43
|
+
*(VALUE *)ptr = klass;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static inline void
|
|
47
|
+
RBASIC_CLEAR_CLASS(VALUE obj)
|
|
48
|
+
{
|
|
49
|
+
RBASIC_SET_CLASS_RAW(obj, 0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static inline void
|
|
53
|
+
RBASIC_SET_CLASS(VALUE obj, VALUE klass)
|
|
54
|
+
{
|
|
55
|
+
VALUE oldv = RBASIC_CLASS(obj);
|
|
56
|
+
RBASIC_SET_CLASS_RAW(obj, klass);
|
|
57
|
+
RB_OBJ_WRITTEN(obj, oldv, klass);
|
|
58
|
+
}
|
|
59
|
+
#endif /* INTERNAL_OBJECT_H */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_PARSE_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for the parser.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
struct rb_iseq_struct; /* in vm_core.h */
|
|
13
|
+
|
|
14
|
+
/* parse.y */
|
|
15
|
+
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
|
16
|
+
void *rb_parser_load_file(VALUE parser, VALUE name);
|
|
17
|
+
void rb_parser_keep_script_lines(VALUE vparser);
|
|
18
|
+
void rb_parser_error_tolerant(VALUE vparser);
|
|
19
|
+
void rb_parser_keep_tokens(VALUE vparser);
|
|
20
|
+
|
|
21
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
22
|
+
VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int);
|
|
23
|
+
RUBY_SYMBOL_EXPORT_END
|
|
24
|
+
|
|
25
|
+
#endif /* INTERNAL_PARSE_H */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef INTERNAL_PROC_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_PROC_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Proc.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for rb_block_call_func_t */
|
|
12
|
+
#include "ruby/st.h" /* for st_index_t */
|
|
13
|
+
struct rb_block; /* in vm_core.h */
|
|
14
|
+
struct rb_iseq_struct; /* in vm_core.h */
|
|
15
|
+
|
|
16
|
+
/* proc.c */
|
|
17
|
+
VALUE rb_proc_location(VALUE self);
|
|
18
|
+
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
|
19
|
+
int rb_block_pair_yield_optimizable(void);
|
|
20
|
+
int rb_block_arity(void);
|
|
21
|
+
int rb_block_min_max_arity(int *max);
|
|
22
|
+
VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additional_info);
|
|
23
|
+
VALUE rb_callable_receiver(VALUE);
|
|
24
|
+
|
|
25
|
+
VALUE rb_func_proc_new(rb_block_call_func_t func, VALUE val);
|
|
26
|
+
VALUE rb_func_lambda_new(rb_block_call_func_t func, VALUE val, int min_argc, int max_argc);
|
|
27
|
+
VALUE rb_iseq_location(const struct rb_iseq_struct *iseq);
|
|
28
|
+
VALUE rb_sym_to_proc(VALUE sym);
|
|
29
|
+
|
|
30
|
+
#endif /* INTERNAL_PROC_H */
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#ifndef INTERNAL_PROCESS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_PROCESS_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Process.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h" /* for rb_pid_t */
|
|
12
|
+
#include <stddef.h> /* for size_t */
|
|
13
|
+
|
|
14
|
+
#ifdef HAVE_SYS_TYPES_H
|
|
15
|
+
# include <sys/types.h> /* for mode_t */
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifdef _WIN32
|
|
19
|
+
# include "ruby/win32.h" /* for mode_t */
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
23
|
+
#include "internal/compilers.h" /* for __has_warning */
|
|
24
|
+
#include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */
|
|
25
|
+
#include "internal/warnings.h" /* for COMPILER_WARNING_PUSH */
|
|
26
|
+
|
|
27
|
+
#define RB_MAX_GROUPS (65536)
|
|
28
|
+
|
|
29
|
+
struct waitpid_state;
|
|
30
|
+
struct rb_process_status;
|
|
31
|
+
struct rb_execarg {
|
|
32
|
+
union {
|
|
33
|
+
struct {
|
|
34
|
+
VALUE shell_script;
|
|
35
|
+
} sh;
|
|
36
|
+
struct {
|
|
37
|
+
VALUE command_name;
|
|
38
|
+
VALUE command_abspath; /* full path string or nil */
|
|
39
|
+
VALUE argv_str;
|
|
40
|
+
VALUE argv_buf;
|
|
41
|
+
} cmd;
|
|
42
|
+
} invoke;
|
|
43
|
+
VALUE redirect_fds;
|
|
44
|
+
VALUE envp_str;
|
|
45
|
+
VALUE envp_buf;
|
|
46
|
+
VALUE dup2_tmpbuf;
|
|
47
|
+
unsigned use_shell : 1;
|
|
48
|
+
unsigned pgroup_given : 1;
|
|
49
|
+
unsigned umask_given : 1;
|
|
50
|
+
unsigned unsetenv_others_given : 1;
|
|
51
|
+
unsigned unsetenv_others_do : 1;
|
|
52
|
+
unsigned close_others_given : 1;
|
|
53
|
+
unsigned close_others_do : 1;
|
|
54
|
+
unsigned chdir_given : 1;
|
|
55
|
+
unsigned new_pgroup_given : 1;
|
|
56
|
+
unsigned new_pgroup_flag : 1;
|
|
57
|
+
unsigned uid_given : 1;
|
|
58
|
+
unsigned gid_given : 1;
|
|
59
|
+
unsigned exception : 1;
|
|
60
|
+
unsigned exception_given : 1;
|
|
61
|
+
struct rb_process_status *status;
|
|
62
|
+
struct waitpid_state *waitpid_state; /* for async process management */
|
|
63
|
+
rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
|
|
64
|
+
VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
|
|
65
|
+
mode_t umask_mask;
|
|
66
|
+
rb_uid_t uid;
|
|
67
|
+
rb_gid_t gid;
|
|
68
|
+
int close_others_maxhint;
|
|
69
|
+
VALUE fd_dup2;
|
|
70
|
+
VALUE fd_close;
|
|
71
|
+
VALUE fd_open;
|
|
72
|
+
VALUE fd_dup2_child;
|
|
73
|
+
VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
|
|
74
|
+
VALUE path_env;
|
|
75
|
+
VALUE chdir_dir;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/* process.c */
|
|
79
|
+
rb_pid_t rb_call_proc__fork(void);
|
|
80
|
+
void rb_last_status_clear(void);
|
|
81
|
+
static inline char **ARGVSTR2ARGV(VALUE argv_str);
|
|
82
|
+
static inline size_t ARGVSTR2ARGC(VALUE argv_str);
|
|
83
|
+
|
|
84
|
+
#ifdef HAVE_PWD_H
|
|
85
|
+
VALUE rb_getlogin(void);
|
|
86
|
+
VALUE rb_getpwdirnam_for_login(VALUE login); /* read as: "get pwd db home dir by username for login" */
|
|
87
|
+
VALUE rb_getpwdiruid(void); /* read as: "get pwd db home dir for getuid()" */
|
|
88
|
+
#endif
|
|
89
|
+
|
|
90
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
91
|
+
/* process.c (export) */
|
|
92
|
+
int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
|
|
93
|
+
rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
|
|
94
|
+
VALUE rb_execarg_new(int argc, const VALUE *argv, int accept_shell, int allow_exc_opt);
|
|
95
|
+
struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
|
|
96
|
+
int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
|
|
97
|
+
void rb_execarg_parent_start(VALUE execarg_obj);
|
|
98
|
+
void rb_execarg_parent_end(VALUE execarg_obj);
|
|
99
|
+
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
|
|
100
|
+
VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
|
|
101
|
+
void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
|
|
102
|
+
RUBY_SYMBOL_EXPORT_END
|
|
103
|
+
|
|
104
|
+
/* argv_str contains extra two elements.
|
|
105
|
+
* The beginning one is for /bin/sh used by exec_with_sh.
|
|
106
|
+
* The last one for terminating NULL used by execve.
|
|
107
|
+
* See rb_exec_fillarg() in process.c. */
|
|
108
|
+
static inline char **
|
|
109
|
+
ARGVSTR2ARGV(VALUE argv_str)
|
|
110
|
+
{
|
|
111
|
+
char **buf = RB_IMEMO_TMPBUF_PTR(argv_str);
|
|
112
|
+
return &buf[1];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static inline size_t
|
|
116
|
+
ARGVSTR2ARGC(VALUE argv_str)
|
|
117
|
+
{
|
|
118
|
+
size_t i = 0;
|
|
119
|
+
char *const *p = ARGVSTR2ARGV(argv_str);
|
|
120
|
+
while (p[i++])
|
|
121
|
+
;
|
|
122
|
+
return i - 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
#ifdef HAVE_WORKING_FORK
|
|
126
|
+
COMPILER_WARNING_PUSH
|
|
127
|
+
#if __has_warning("-Wdeprecated-declarations") || RBIMPL_COMPILER_IS(GCC)
|
|
128
|
+
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
|
|
129
|
+
#endif
|
|
130
|
+
static inline rb_pid_t
|
|
131
|
+
rb_fork(void)
|
|
132
|
+
{
|
|
133
|
+
return fork();
|
|
134
|
+
}
|
|
135
|
+
COMPILER_WARNING_POP
|
|
136
|
+
#endif
|
|
137
|
+
|
|
138
|
+
#endif /* INTERNAL_PROCESS_H */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#ifndef INTERNAL_RANDOM_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_RANDOM_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Random.
|
|
10
|
+
*/
|
|
11
|
+
#include <stddef.h> /* for size_t */
|
|
12
|
+
|
|
13
|
+
/* random.c */
|
|
14
|
+
int ruby_fill_random_bytes(void *, size_t, int);
|
|
15
|
+
|
|
16
|
+
#endif /* INTERNAL_RANDOM_H */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_RANGE_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Range.
|
|
10
|
+
*/
|
|
11
|
+
#include "internal/struct.h" /* for RSTRUCT */
|
|
12
|
+
|
|
13
|
+
/* range.c */
|
|
14
|
+
static inline VALUE RANGE_BEG(VALUE r);
|
|
15
|
+
static inline VALUE RANGE_END(VALUE r);
|
|
16
|
+
static inline VALUE RANGE_EXCL(VALUE r);
|
|
17
|
+
|
|
18
|
+
static inline VALUE
|
|
19
|
+
RANGE_BEG(VALUE r)
|
|
20
|
+
{
|
|
21
|
+
return RSTRUCT(r)->as.ary[0];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static inline VALUE
|
|
25
|
+
RANGE_END(VALUE r)
|
|
26
|
+
{
|
|
27
|
+
return RSTRUCT(r)->as.ary[1];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static inline VALUE
|
|
31
|
+
RANGE_EXCL(VALUE r)
|
|
32
|
+
{
|
|
33
|
+
return RSTRUCT(r)->as.ary[2];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
VALUE
|
|
37
|
+
rb_range_component_beg_len(VALUE b, VALUE e, int excl,
|
|
38
|
+
long *begp, long *lenp, long len, int err);
|
|
39
|
+
|
|
40
|
+
#endif /* INTERNAL_RANGE_H */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#ifndef INTERNAL_RATIONAL_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_RATIONAL_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Rational.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h" /* for HAVE_LIBGMP */
|
|
12
|
+
#include "ruby/ruby.h" /* for struct RBasic */
|
|
13
|
+
#include "internal/numeric.h" /* for INT_POSITIVE_P */
|
|
14
|
+
#include "ruby_assert.h" /* for assert */
|
|
15
|
+
|
|
16
|
+
struct RRational {
|
|
17
|
+
struct RBasic basic;
|
|
18
|
+
VALUE num;
|
|
19
|
+
VALUE den;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
#define RRATIONAL(obj) ((struct RRational *)(obj))
|
|
23
|
+
|
|
24
|
+
/* rational.c */
|
|
25
|
+
VALUE rb_rational_canonicalize(VALUE x);
|
|
26
|
+
VALUE rb_rational_uminus(VALUE self);
|
|
27
|
+
VALUE rb_rational_plus(VALUE self, VALUE other);
|
|
28
|
+
VALUE rb_rational_minus(VALUE self, VALUE other);
|
|
29
|
+
VALUE rb_rational_mul(VALUE self, VALUE other);
|
|
30
|
+
VALUE rb_rational_div(VALUE self, VALUE other);
|
|
31
|
+
VALUE rb_lcm(VALUE x, VALUE y);
|
|
32
|
+
VALUE rb_rational_reciprocal(VALUE x);
|
|
33
|
+
VALUE rb_cstr_to_rat(const char *, int);
|
|
34
|
+
VALUE rb_rational_hash(VALUE self);
|
|
35
|
+
VALUE rb_rational_abs(VALUE self);
|
|
36
|
+
VALUE rb_rational_cmp(VALUE self, VALUE other);
|
|
37
|
+
VALUE rb_rational_pow(VALUE self, VALUE other);
|
|
38
|
+
VALUE rb_rational_floor(VALUE self, int ndigits);
|
|
39
|
+
VALUE rb_numeric_quo(VALUE x, VALUE y);
|
|
40
|
+
VALUE rb_flo_round_by_rational(int argc, VALUE *argv, VALUE num);
|
|
41
|
+
VALUE rb_float_numerator(VALUE x);
|
|
42
|
+
VALUE rb_float_denominator(VALUE x);
|
|
43
|
+
|
|
44
|
+
static inline void RATIONAL_SET_NUM(VALUE r, VALUE n);
|
|
45
|
+
static inline void RATIONAL_SET_DEN(VALUE r, VALUE d);
|
|
46
|
+
|
|
47
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
48
|
+
/* rational.c (export) */
|
|
49
|
+
VALUE rb_gcd(VALUE x, VALUE y);
|
|
50
|
+
VALUE rb_gcd_normal(VALUE self, VALUE other);
|
|
51
|
+
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
|
|
52
|
+
VALUE rb_gcd_gmp(VALUE x, VALUE y);
|
|
53
|
+
#endif
|
|
54
|
+
RUBY_SYMBOL_EXPORT_END
|
|
55
|
+
|
|
56
|
+
static inline void
|
|
57
|
+
RATIONAL_SET_NUM(VALUE r, VALUE n)
|
|
58
|
+
{
|
|
59
|
+
assert(RB_INTEGER_TYPE_P(n));
|
|
60
|
+
RB_OBJ_WRITE(r, &RRATIONAL(r)->num, n);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static inline void
|
|
64
|
+
RATIONAL_SET_DEN(VALUE r, VALUE d)
|
|
65
|
+
{
|
|
66
|
+
assert(RB_INTEGER_TYPE_P(d));
|
|
67
|
+
assert(INT_POSITIVE_P(d));
|
|
68
|
+
RB_OBJ_WRITE(r, &RRATIONAL(r)->den, d);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
#endif /* INTERNAL_RATIONAL_H */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#ifndef INTERNAL_RE_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_RE_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Regexp.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
12
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
13
|
+
|
|
14
|
+
/* re.c */
|
|
15
|
+
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
|
16
|
+
VALUE rb_reg_check_preprocess(VALUE);
|
|
17
|
+
long rb_reg_search0(VALUE, VALUE, long, int, int);
|
|
18
|
+
VALUE rb_reg_match_p(VALUE re, VALUE str, long pos);
|
|
19
|
+
bool rb_reg_start_with_p(VALUE re, VALUE str);
|
|
20
|
+
VALUE rb_reg_hash(VALUE re);
|
|
21
|
+
VALUE rb_reg_equal(VALUE re1, VALUE re2);
|
|
22
|
+
void rb_backref_set_string(VALUE string, long pos, long len);
|
|
23
|
+
void rb_match_unbusy(VALUE);
|
|
24
|
+
int rb_match_count(VALUE match);
|
|
25
|
+
int rb_match_nth_defined(int nth, VALUE match);
|
|
26
|
+
VALUE rb_reg_new_ary(VALUE ary, int options);
|
|
27
|
+
|
|
28
|
+
#endif /* INTERNAL_RE_H */
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
#ifndef INTERNAL_SANITIZERS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_SANITIZERS_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for ASAN / MSAN / etc.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h"
|
|
12
|
+
#include "internal/compilers.h" /* for __has_feature */
|
|
13
|
+
|
|
14
|
+
#ifdef HAVE_VALGRIND_MEMCHECK_H
|
|
15
|
+
# include <valgrind/memcheck.h>
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifdef HAVE_SANITIZER_ASAN_INTERFACE_H
|
|
19
|
+
# include <sanitizer/asan_interface.h>
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#ifdef HAVE_SANITIZER_MSAN_INTERFACE_H
|
|
23
|
+
# if __has_feature(memory_sanitizer)
|
|
24
|
+
# include <sanitizer/msan_interface.h>
|
|
25
|
+
# endif
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#include "ruby/internal/stdbool.h" /* for bool */
|
|
29
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
30
|
+
|
|
31
|
+
#if 0
|
|
32
|
+
#elif __has_feature(memory_sanitizer) && __has_feature(address_sanitizer)
|
|
33
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
34
|
+
__attribute__((__no_sanitize__("memory, address"), __noinline__)) x
|
|
35
|
+
#elif __has_feature(address_sanitizer)
|
|
36
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
37
|
+
__attribute__((__no_sanitize__("address"), __noinline__)) x
|
|
38
|
+
#elif defined(NO_SANITIZE_ADDRESS)
|
|
39
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
40
|
+
NO_SANITIZE_ADDRESS(NOINLINE(x))
|
|
41
|
+
#elif defined(NO_ADDRESS_SAFETY_ANALYSIS)
|
|
42
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) \
|
|
43
|
+
NO_ADDRESS_SAFETY_ANALYSIS(NOINLINE(x))
|
|
44
|
+
#else
|
|
45
|
+
# define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
#if defined(NO_SANITIZE) && RBIMPL_COMPILER_IS(GCC)
|
|
49
|
+
/* GCC warns about unknown sanitizer, which is annoying. */
|
|
50
|
+
# include "internal/warnings.h"
|
|
51
|
+
# undef NO_SANITIZE
|
|
52
|
+
# define NO_SANITIZE(x, y) \
|
|
53
|
+
COMPILER_WARNING_PUSH; \
|
|
54
|
+
COMPILER_WARNING_IGNORED(-Wattributes); \
|
|
55
|
+
__attribute__((__no_sanitize__(x))) y; \
|
|
56
|
+
COMPILER_WARNING_POP
|
|
57
|
+
#endif
|
|
58
|
+
|
|
59
|
+
#ifndef NO_SANITIZE
|
|
60
|
+
# define NO_SANITIZE(x, y) y
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#if !__has_feature(address_sanitizer)
|
|
64
|
+
# define __asan_poison_memory_region(x, y)
|
|
65
|
+
# define __asan_unpoison_memory_region(x, y)
|
|
66
|
+
# define __asan_region_is_poisoned(x, y) 0
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#if !__has_feature(memory_sanitizer)
|
|
70
|
+
# define __msan_allocated_memory(x, y) ((void)(x), (void)(y))
|
|
71
|
+
# define __msan_poison(x, y) ((void)(x), (void)(y))
|
|
72
|
+
# define __msan_unpoison(x, y) ((void)(x), (void)(y))
|
|
73
|
+
# define __msan_unpoison_string(x) ((void)(x))
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
#ifdef VALGRIND_MAKE_READABLE
|
|
77
|
+
# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
|
|
78
|
+
#endif
|
|
79
|
+
|
|
80
|
+
#ifdef VALGRIND_MAKE_WRITABLE
|
|
81
|
+
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#ifndef VALGRIND_MAKE_MEM_DEFINED
|
|
85
|
+
# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
|
|
86
|
+
#endif
|
|
87
|
+
|
|
88
|
+
#ifndef VALGRIND_MAKE_MEM_UNDEFINED
|
|
89
|
+
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
|
|
90
|
+
#endif
|
|
91
|
+
|
|
92
|
+
/*!
|
|
93
|
+
* This function asserts that a (continuous) memory region from ptr to size
|
|
94
|
+
* being "poisoned". Both read / write access to such memory region are
|
|
95
|
+
* prohibited until properly unpoisoned. The region must be previously
|
|
96
|
+
* allocated (do not pass a freed pointer here), but not necessarily be an
|
|
97
|
+
* entire object that the malloc returns. You can punch hole a part of a
|
|
98
|
+
* gigantic heap arena. This is handy when you do not free an allocated memory
|
|
99
|
+
* region to reuse later: poison when you keep it unused, and unpoison when you
|
|
100
|
+
* reuse.
|
|
101
|
+
*
|
|
102
|
+
* \param[in] ptr pointer to the beginning of the memory region to poison.
|
|
103
|
+
* \param[in] size the length of the memory region to poison.
|
|
104
|
+
*/
|
|
105
|
+
static inline void
|
|
106
|
+
asan_poison_memory_region(const volatile void *ptr, size_t size)
|
|
107
|
+
{
|
|
108
|
+
__msan_poison(ptr, size);
|
|
109
|
+
__asan_poison_memory_region(ptr, size);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/*!
|
|
113
|
+
* This is a variant of asan_poison_memory_region that takes a VALUE.
|
|
114
|
+
*
|
|
115
|
+
* \param[in] obj target object.
|
|
116
|
+
*/
|
|
117
|
+
static inline void
|
|
118
|
+
asan_poison_object(VALUE obj)
|
|
119
|
+
{
|
|
120
|
+
MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
|
|
121
|
+
asan_poison_memory_region(ptr, SIZEOF_VALUE);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#if !__has_feature(address_sanitizer)
|
|
125
|
+
#define asan_poison_object_if(ptr, obj) ((void)(ptr), (void)(obj))
|
|
126
|
+
#else
|
|
127
|
+
#define asan_poison_object_if(ptr, obj) do { \
|
|
128
|
+
if (ptr) asan_poison_object(obj); \
|
|
129
|
+
} while (0)
|
|
130
|
+
#endif
|
|
131
|
+
|
|
132
|
+
/*!
|
|
133
|
+
* This function predicates if the given object is fully addressable or not.
|
|
134
|
+
*
|
|
135
|
+
* \param[in] obj target object.
|
|
136
|
+
* \retval 0 the given object is fully addressable.
|
|
137
|
+
* \retval otherwise pointer to first such byte who is poisoned.
|
|
138
|
+
*/
|
|
139
|
+
static inline void *
|
|
140
|
+
asan_poisoned_object_p(VALUE obj)
|
|
141
|
+
{
|
|
142
|
+
MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
|
|
143
|
+
return __asan_region_is_poisoned(ptr, SIZEOF_VALUE);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/*!
|
|
147
|
+
* This function asserts that a (formally poisoned) memory region from ptr to
|
|
148
|
+
* size is now addressable. Write access to such memory region gets allowed.
|
|
149
|
+
* However read access might or might not be possible depending on situations,
|
|
150
|
+
* because the region can have contents of previous usages. That information
|
|
151
|
+
* should be passed by the malloc_p flag. If that is true, the contents of the
|
|
152
|
+
* region is _not_ fully defined (like the return value of malloc behaves).
|
|
153
|
+
* Reading from there is NG; write something first. If malloc_p is false on
|
|
154
|
+
* the other hand, that memory region is fully defined and can be read
|
|
155
|
+
* immediately.
|
|
156
|
+
*
|
|
157
|
+
* \param[in] ptr pointer to the beginning of the memory region to unpoison.
|
|
158
|
+
* \param[in] size the length of the memory region.
|
|
159
|
+
* \param[in] malloc_p if the memory region is like a malloc's return value or not.
|
|
160
|
+
*/
|
|
161
|
+
static inline void
|
|
162
|
+
asan_unpoison_memory_region(const volatile void *ptr, size_t size, bool malloc_p)
|
|
163
|
+
{
|
|
164
|
+
__asan_unpoison_memory_region(ptr, size);
|
|
165
|
+
if (malloc_p) {
|
|
166
|
+
__msan_allocated_memory(ptr, size);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
__msan_unpoison(ptr, size);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/*!
|
|
174
|
+
* This is a variant of asan_unpoison_memory_region that takes a VALUE.
|
|
175
|
+
*
|
|
176
|
+
* \param[in] obj target object.
|
|
177
|
+
* \param[in] malloc_p if the memory region is like a malloc's return value or not.
|
|
178
|
+
*/
|
|
179
|
+
static inline void
|
|
180
|
+
asan_unpoison_object(VALUE obj, bool newobj_p)
|
|
181
|
+
{
|
|
182
|
+
MAYBE_UNUSED(struct RVALUE *) ptr = (void *)obj;
|
|
183
|
+
asan_unpoison_memory_region(ptr, SIZEOF_VALUE, newobj_p);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
#endif /* INTERNAL_SANITIZERS_H */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#ifndef INTERNAL_SERIAL_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_SERIAL_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for rb_serial_t.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h" /* for HAVE_LONG_LONG */
|
|
12
|
+
#include "ruby/defines.h" /* for LONG_LONG */
|
|
13
|
+
|
|
14
|
+
#ifndef HAVE_LONG_LONG
|
|
15
|
+
# error need C99+
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
typedef unsigned LONG_LONG rb_serial_t;
|
|
19
|
+
#define SERIALT2NUM ULL2NUM
|
|
20
|
+
#define PRI_SERIALT_PREFIX PRI_LL_PREFIX
|
|
21
|
+
#define SIZEOF_SERIAL_T SIZEOF_LONG_LONG
|
|
22
|
+
|
|
23
|
+
#endif /* INTERNAL_SERIAL_H */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef INTERNAL_SIGNAL_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_SIGNAL_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for SignalException.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* signal.c */
|
|
13
|
+
extern int ruby_enable_coredump;
|
|
14
|
+
int rb_get_next_signal(void);
|
|
15
|
+
|
|
16
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
17
|
+
/* signal.c (export) */
|
|
18
|
+
int rb_grantpt(int fd);
|
|
19
|
+
RUBY_SYMBOL_EXPORT_END
|
|
20
|
+
|
|
21
|
+
#endif /* INTERNAL_SIGNAL_H */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#ifndef INTERNAL_STATIC_ASSERT_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_STATIC_ASSERT_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief C11 shim for _Static_assert.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/static_assert.h"
|
|
12
|
+
#ifndef STATIC_ASSERT
|
|
13
|
+
# define STATIC_ASSERT RBIMPL_STATIC_ASSERT
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#endif /* INTERNAL_STATIC_ASSERT_H */
|