Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

eval_error.c
Go to the documentation of this file.
1 /* -*-c-*- */
2 /*
3 * included by eval.c
4 */
5
6 #define write_warn(str, x) \
7 (NIL_P(str) ? warn_print(x) : (void)rb_str_cat_cstr(str, x))
8 #define write_warn2(str, x, l) \
9 (NIL_P(str) ? warn_print2(x, l) : (void)rb_str_cat(str, x, l))
10 #ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
11 #define warn_print(x) RB_GNUC_EXTENSION_BLOCK( \
12 (__builtin_constant_p(x)) ? \
13 rb_write_error2((x), (long)strlen(x)) : \
14 rb_write_error(x) \
15 )
16 #else
17 #define warn_print(x) rb_write_error(x)
18 #endif
19
20 #define warn_print2(x,l) rb_write_error2((x),(l))
21
22 #define write_warn_str(str,x) NIL_P(str) ? rb_write_error_str(x) : (void)rb_str_concat((str), (x))
23 #define warn_print_str(x) rb_write_error_str(x)
24
25 static VALUE error_pos_str(void);
26
27 static void
28 error_pos(const VALUE str)
29 {
30 VALUE pos = error_pos_str();
31 if (!NIL_P(pos)) {
32 write_warn_str(str, pos);
33 }
34 }
35
36 static VALUE
37 error_pos_str(void)
38 {
39 int sourceline;
40 VALUE sourcefile = rb_source_location(&sourceline);
41
42 if (!NIL_P(sourcefile)) {
43 ID caller_name;
44 if (sourceline == 0) {
45 return rb_sprintf("%"PRIsVALUE": ", sourcefile);
46 }
47 else if ((caller_name = rb_frame_callee()) != 0) {
48 return rb_sprintf("%"PRIsVALUE":%d:in `%"PRIsVALUE"': ",
49 sourcefile, sourceline,
50 rb_id2str(caller_name));
51 }
52 else {
53 return rb_sprintf("%"PRIsVALUE":%d: ", sourcefile, sourceline);
54 }
55 }
56 return Qnil;
57 }
58
59 static void
60 set_backtrace(VALUE info, VALUE bt)
61 {
62 ID set_backtrace = rb_intern("set_backtrace");
63
64 if (rb_backtrace_p(bt)) {
65 if (rb_method_basic_definition_p(CLASS_OF(info), set_backtrace)) {
66 rb_exc_set_backtrace(info, bt);
67 return;
68 }
69 else {
70 bt = rb_backtrace_to_str_ary(bt);
71 }
72 }
73 rb_check_funcall(info, set_backtrace, 1, &bt);
74 }
75
76 static void
77 error_print(rb_execution_context_t *ec)
78 {
79 rb_ec_error_print(ec, ec->errinfo);
80 }
81
82 static void
83 write_warnq(VALUE out, VALUE str, const char *ptr, long len)
84 {
85 if (NIL_P(out)) {
86 const char *beg = ptr;
87 const long olen = len;
88 for (; len > 0; --len, ++ptr) {
89 unsigned char c = *ptr;
90 switch (c) {
91 case '\n': case '\t': continue;
92 }
93 if (rb_iscntrl(c)) {
94 char buf[5];
95 const char *cc = 0;
96 if (ptr > beg) rb_write_error2(beg, ptr - beg);
97 beg = ptr + 1;
98 cc = ruby_escaped_char(c);
99 if (cc) {
100 rb_write_error2(cc, strlen(cc));
101 }
102 else {
103 rb_write_error2(buf, snprintf(buf, sizeof(buf), "\\x%02X", c));
104 }
105 }
106 else if (c == '\\') {
107 rb_write_error2(beg, ptr - beg + 1);
108 beg = ptr;
109 }
110 }
111 if (ptr > beg) {
112 if (beg == RSTRING_PTR(str) && olen == RSTRING_LEN(str))
113 rb_write_error_str(str);
114 else
115 rb_write_error2(beg, ptr - beg);
116 }
117 }
118 else {
119 rb_str_cat(out, ptr, len);
120 }
121 }
122
123 #define CSI_BEGIN "\033["
124 #define CSI_SGR "m"
125
126 static const char underline[] = CSI_BEGIN"1;4"CSI_SGR;
127 static const char bold[] = CSI_BEGIN"1"CSI_SGR;
128 static const char reset[] = CSI_BEGIN""CSI_SGR;
129
130 static void
131 print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int highlight)
132 {
133 const char *einfo = "";
134 long elen = 0;
135 VALUE mesg;
136
137 if (emesg != Qundef) {
138 if (NIL_P(errat) || RARRAY_LEN(errat) == 0 ||
139 NIL_P(mesg = RARRAY_AREF(errat, 0))) {
140 error_pos(str);
141 }
142 else {
143 write_warn_str(str, mesg);
144 write_warn(str, ": ");
145 }
146
147 if (!NIL_P(emesg)) {
148 einfo = RSTRING_PTR(emesg);
149 elen = RSTRING_LEN(emesg);
150 }
151 }
152
153 if (eclass == rb_eRuntimeError && elen == 0) {
154 if (highlight) write_warn(str, underline);
155 write_warn(str, "unhandled exception");
156 if (highlight) write_warn(str, reset);
157 write_warn2(str, "\n", 1);
158 }
159 else {
160 VALUE epath;
161
162 epath = rb_class_name(eclass);
163 if (elen == 0) {
164 if (highlight) write_warn(str, underline);
165 write_warn_str(str, epath);
166 if (highlight) write_warn(str, reset);
167 write_warn(str, "\n");
168 }
169 else {
170 /* emesg is a String instance */
171 const char *tail = 0;
172
173 if (highlight) write_warn(str, bold);
174 if (RSTRING_PTR(epath)[0] == '#')
175 epath = 0;
176 if ((tail = memchr(einfo, '\n', elen)) != 0) {
177 write_warnq(str, emesg, einfo, tail - einfo);
178 tail++; /* skip newline */
179 }
180 else {
181 write_warnq(str, emesg, einfo, elen);
182 }
183 if (epath) {
184 write_warn(str, " (");
185 if (highlight) write_warn(str, underline);
186 write_warn_str(str, epath);
187 if (highlight) {
188 write_warn(str, reset);
189 write_warn(str, bold);
190 }
191 write_warn2(str, ")", 1);
192 if (highlight) write_warn(str, reset);
193 write_warn2(str, "\n", 1);
194 }
195 if (tail && einfo+elen > tail) {
196 if (!highlight) {
197 write_warnq(str, emesg, tail, einfo+elen-tail);
198 if (einfo[elen-1] != '\n') write_warn2(str, "\n", 1);
199 }
200 else {
201 elen -= tail - einfo;
202 einfo = tail;
203 while (elen > 0) {
204 tail = memchr(einfo, '\n', elen);
205 if (!tail || tail > einfo) {
206 write_warn(str, bold);
207 write_warnq(str, emesg, einfo, tail ? tail-einfo : elen);
208 write_warn(str, reset);
209 if (!tail) {
210 write_warn2(str, "\n", 1);
211 break;
212 }
213 }
214 elen -= tail - einfo;
215 einfo = tail;
216 do ++tail; while (tail < einfo+elen && *tail == '\n');
217 write_warnq(str, emesg, einfo, tail-einfo);
218 elen -= tail - einfo;
219 einfo = tail;
220 }
221 }
222 }
223 else if (!epath) {
224 write_warn2(str, "\n", 1);
225 }
226 }
227 }
228 }
229
230 static void
231 print_backtrace(const VALUE eclass, const VALUE errat, const VALUE str, int reverse)
232 {
233 if (!NIL_P(errat)) {
234 long i;
235 long len = RARRAY_LEN(errat);
236 int skip = eclass == rb_eSysStackError;
237 const int threshold = 1000000000;
238 int width = (len <= 1) ? INT_MIN : ((int)log10((double)(len > threshold ?
239 ((len - 1) / threshold) :
240 len - 1)) +
241 (len < threshold ? 0 : 9) + 1);
242
243 #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
244 #define TRACE_HEAD 8
245 #define TRACE_TAIL 5
246
247 for (i = 1; i < len; i++) {
248 VALUE line = RARRAY_AREF(errat, reverse ? len - i : i);
249 if (RB_TYPE_P(line, T_STRING)) {
250 VALUE bt = rb_str_new_cstr("\t");
251 if (reverse) rb_str_catf(bt, "%*ld: ", width, len - i);
252 write_warn_str(str, rb_str_catf(bt, "from %"PRIsVALUE"\n", line));
253 }
254 if (skip && i == TRACE_HEAD && len > TRACE_MAX) {
255 write_warn_str(str, rb_sprintf("\t ... %ld levels...\n",
256 len - TRACE_HEAD - TRACE_TAIL));
257 i = len - TRACE_TAIL;
258 }
259 }
260 }
261 }
262
263 VALUE rb_get_message(VALUE exc);
264
265 static int
266 shown_cause_p(VALUE cause, VALUE *shown_causes)
267 {
268 VALUE shown = *shown_causes;
269 if (!shown) {
270 *shown_causes = shown = rb_obj_hide(rb_ident_hash_new());
271 }
272 if (rb_hash_has_key(shown, cause)) return TRUE;
273 rb_hash_aset(shown, cause, Qtrue);
274 return FALSE;
275 }
276
277 static void
278 show_cause(VALUE errinfo, VALUE str, VALUE highlight, VALUE reverse, VALUE *shown_causes)
279 {
280 VALUE cause = rb_attr_get(errinfo, id_cause);
281 if (!NIL_P(cause) && rb_obj_is_kind_of(cause, rb_eException) &&
282 !shown_cause_p(cause, shown_causes)) {
283 volatile VALUE eclass = CLASS_OF(cause);
284 VALUE errat = rb_get_backtrace(cause);
285 VALUE emesg = rb_get_message(cause);
286 if (reverse) {
287 show_cause(cause, str, highlight, reverse, shown_causes);
288 print_backtrace(eclass, errat, str, TRUE);
289 print_errinfo(eclass, errat, emesg, str, highlight!=0);
290 }
291 else {
292 print_errinfo(eclass, errat, emesg, str, highlight!=0);
293 print_backtrace(eclass, errat, str, FALSE);
294 show_cause(cause, str, highlight, reverse, shown_causes);
295 }
296 }
297 }
298
299 void
300 rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse)
301 {
302 volatile VALUE eclass;
303 VALUE shown_causes = 0;
304
305 if (NIL_P(errinfo))
306 return;
307
308 if (errat == Qundef) {
309 errat = Qnil;
310 }
311 eclass = CLASS_OF(errinfo);
312 if (NIL_P(reverse) || NIL_P(highlight)) {
313 VALUE tty = (VALUE)rb_stderr_tty_p();
314 if (NIL_P(reverse)) reverse = tty;
315 if (NIL_P(highlight)) highlight = tty;
316 }
317 if (reverse) {
318 static const char traceback[] = "Traceback "
319 "(most recent call last):\n";
320 const int bold_part = rb_strlen_lit("Traceback");
321 char buff[sizeof(traceback)+sizeof(bold)+sizeof(reset)-2], *p = buff;
322 const char *msg = traceback;
323 long len = sizeof(traceback) - 1;
324 if (highlight) {
325 #define APPEND(s, l) (memcpy(p, s, l), p += (l))
326 APPEND(bold, sizeof(bold)-1);
327 APPEND(traceback, bold_part);
328 APPEND(reset, sizeof(reset)-1);
329 APPEND(traceback + bold_part, sizeof(traceback)-bold_part-1);
330 #undef APPEND
331 len = p - (msg = buff);
332 }
333 write_warn2(str, msg, len);
334 show_cause(errinfo, str, highlight, reverse, &shown_causes);
335 print_backtrace(eclass, errat, str, TRUE);
336 print_errinfo(eclass, errat, emesg, str, highlight!=0);
337 }
338 else {
339 print_errinfo(eclass, errat, emesg, str, highlight!=0);
340 print_backtrace(eclass, errat, str, FALSE);
341 show_cause(errinfo, str, highlight, reverse, &shown_causes);
342 }
343 }
344
345 void
346 rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo)
347 {
348 volatile uint8_t raised_flag = ec->raised_flag;
349 volatile VALUE errat = Qundef;
350 volatile VALUE emesg = Qundef;
351
352 if (NIL_P(errinfo))
353 return;
354 rb_ec_raised_clear(ec);
355
356 EC_PUSH_TAG(ec);
357 if (EC_EXEC_TAG() == TAG_NONE) {
358 errat = rb_get_backtrace(errinfo);
359 }
360 if (emesg == Qundef) {
361 emesg = Qnil;
362 emesg = rb_get_message(errinfo);
363 }
364
365 rb_error_write(errinfo, emesg, errat, Qnil, Qnil, Qnil);
366
367 EC_POP_TAG();
368 ec->errinfo = errinfo;
369 rb_ec_raised_set(ec, raised_flag);
370 }
371
372 #define undef_mesg_for(v, k) rb_fstring_lit("undefined"v" method `%1$s' for "k" `%2$s'")
373 #define undef_mesg(v) ( \
374 is_mod ? \
375 undef_mesg_for(v, "module") : \
376 undef_mesg_for(v, "class"))
377
378 void
379 rb_print_undef(VALUE klass, ID id, rb_method_visibility_t visi)
380 {
381 const int is_mod = RB_TYPE_P(klass, T_MODULE);
382 VALUE mesg;
383 switch (visi & METHOD_VISI_MASK) {
384 case METHOD_VISI_UNDEF:
385 case METHOD_VISI_PUBLIC: mesg = undef_mesg(""); break;
386 case METHOD_VISI_PRIVATE: mesg = undef_mesg(" private"); break;
387 case METHOD_VISI_PROTECTED: mesg = undef_mesg(" protected"); break;
388 default: UNREACHABLE;
389 }
390 rb_name_err_raise_str(mesg, klass, ID2SYM(id));
391 }
392
393 void
394 rb_print_undef_str(VALUE klass, VALUE name)
395 {
396 const int is_mod = RB_TYPE_P(klass, T_MODULE);
397 rb_name_err_raise_str(undef_mesg(""), klass, name);
398 }
399
400 #define inaccessible_mesg_for(v, k) rb_fstring_lit("method `%1$s' for "k" `%2$s' is "v)
401 #define inaccessible_mesg(v) ( \
402 is_mod ? \
403 inaccessible_mesg_for(v, "module") : \
404 inaccessible_mesg_for(v, "class"))
405
406 void
407 rb_print_inaccessible(VALUE klass, ID id, rb_method_visibility_t visi)
408 {
409 const int is_mod = RB_TYPE_P(klass, T_MODULE);
410 VALUE mesg;
411 switch (visi & METHOD_VISI_MASK) {
412 case METHOD_VISI_UNDEF:
413 case METHOD_VISI_PUBLIC: mesg = inaccessible_mesg(""); break;
414 case METHOD_VISI_PRIVATE: mesg = inaccessible_mesg(" private"); break;
415 case METHOD_VISI_PROTECTED: mesg = inaccessible_mesg(" protected"); break;
416 default: UNREACHABLE;
417 }
418 rb_name_err_raise_str(mesg, klass, ID2SYM(id));
419 }
420
421 static int
422 sysexit_status(VALUE err)
423 {
424 VALUE st = rb_ivar_get(err, id_status);
425 return NUM2INT(st);
426 }
427
428 #define unknown_longjmp_status(status) \
429 rb_bug("Unknown longjmp status %d", status)
430
431 static int
432 error_handle(rb_execution_context_t *ec, int ex)
433 {
434 int status = EXIT_FAILURE;
435
436 if (rb_ec_set_raised(ec))
437 return EXIT_FAILURE;
438 switch (ex & TAG_MASK) {
439 case 0:
440 status = EXIT_SUCCESS;
441 break;
442
443 case TAG_RETURN:
444 error_pos(Qnil);
445 warn_print("unexpected return\n");
446 break;
447 case TAG_NEXT:
448 error_pos(Qnil);
449 warn_print("unexpected next\n");
450 break;
451 case TAG_BREAK:
452 error_pos(Qnil);
453 warn_print("unexpected break\n");
454 break;
455 case TAG_REDO:
456 error_pos(Qnil);
457 warn_print("unexpected redo\n");
458 break;
459 case TAG_RETRY:
460 error_pos(Qnil);
461 warn_print("retry outside of rescue clause\n");
462 break;
463 case TAG_THROW:
464 /* TODO: fix me */
465 error_pos(Qnil);
466 warn_print("unexpected throw\n");
467 break;
468 case TAG_RAISE: {
469 VALUE errinfo = ec->errinfo;
470 if (rb_obj_is_kind_of(errinfo, rb_eSystemExit)) {
471 status = sysexit_status(errinfo);
472 }
473 else if (rb_obj_is_instance_of(errinfo, rb_eSignal) &&
474 rb_ivar_get(errinfo, id_signo) != INT2FIX(SIGSEGV)) {
475 /* no message when exiting by signal */
476 }
477 else {
478 rb_ec_error_print(ec, errinfo);
479 }
480 break;
481 }
482 case TAG_FATAL:
483 error_print(ec);
484 break;
485 default:
486 unknown_longjmp_status(ex);
487 break;
488 }
489 rb_ec_reset_raised(ec);
490 return status;
491 }
rb_execution_context_struct::raised_flag
uint8_t raised_flag
Definition: vm_core.h:878
METHOD_VISI_PRIVATE
@ METHOD_VISI_PRIVATE
Definition: method.h:29
ID
unsigned long ID
Definition: ruby.h:103
rb_check_funcall
VALUE rb_check_funcall(VALUE, ID, int, const VALUE *)
Definition: vm_eval.c:505
rb_method_basic_definition_p
#define rb_method_basic_definition_p(klass, mid)
Definition: rb_mjit_min_header-2.7.0.h:7900
TRUE
#define TRUE
Definition: nkf.h:175
rb_ec_error_print
void rb_ec_error_print(rb_execution_context_t *volatile ec, volatile VALUE errinfo)
Definition: eval_error.c:346
rb_obj_hide
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Definition: object.c:78
rb_ec_raised_clear
#define rb_ec_raised_clear(ec)
Definition: eval_intern.h:261
rb_ident_hash_new
VALUE rb_ident_hash_new(void)
Definition: hash.c:4203
INT2FIX
#define INT2FIX(i)
Definition: ruby.h:263
snprintf
int snprintf(char *__restrict, size_t, const char *__restrict,...) __attribute__((__format__(__printf__
rb_print_undef
void rb_print_undef(VALUE klass, ID id, rb_method_visibility_t visi)
Definition: eval_error.c:379
RSTRING_PTR
#define RSTRING_PTR(str)
Definition: ruby.h:1009
METHOD_VISI_MASK
@ METHOD_VISI_MASK
Definition: method.h:32
rb_attr_get
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1084
VALUE
unsigned long VALUE
Definition: ruby.h:102
rb_intern
#define rb_intern(str)
RB_TYPE_P
#define RB_TYPE_P(obj, type)
Definition: ruby.h:560
TAG_FATAL
#define TAG_FATAL
Definition: vm_core.h:205
INT_MIN
#define INT_MIN
Definition: rb_mjit_min_header-2.7.0.h:4050
rb_eSignal
VALUE rb_eSignal
Definition: error.c:917
rb_error_write
void rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE highlight, VALUE reverse)
Definition: eval_error.c:300
rb_method_visibility_t
rb_method_visibility_t
Definition: method.h:26
Qundef
#define Qundef
Definition: ruby.h:470
EXIT_FAILURE
#define EXIT_FAILURE
Definition: eval_intern.h:32
ptr
struct RIMemo * ptr
Definition: debug.c:74
APPEND
#define APPEND(s, l)
id_cause
#define id_cause
Definition: error.c:946
rb_id2str
#define rb_id2str(id)
Definition: vm_backtrace.c:30
rb_stderr_tty_p
int rb_stderr_tty_p(void)
Definition: io.c:7958
PRIsVALUE
#define PRIsVALUE
Definition: ruby.h:166
rb_write_error2
void rb_write_error2(const char *, long)
Definition: io.c:7911
ID2SYM
#define ID2SYM(x)
Definition: ruby.h:414
strlen
size_t strlen(const char *)
rb_hash_has_key
MJIT_FUNC_EXPORTED VALUE rb_hash_has_key(VALUE hash, VALUE key)
Definition: hash.c:3432
cc
const struct rb_call_cache * cc
Definition: rb_mjit_min_header-2.7.0.h:13228
rb_ivar_get
VALUE rb_ivar_get(VALUE, ID)
Definition: variable.c:1070
id_signo
#define id_signo
Definition: internal.h:1587
rb_backtrace_to_str_ary
VALUE rb_backtrace_to_str_ary(VALUE obj)
Definition: vm_backtrace.c:620
EC_POP_TAG
#define EC_POP_TAG()
Definition: eval_intern.h:137
TAG_REDO
#define TAG_REDO
Definition: vm_core.h:202
write_warn2
#define write_warn2(str, x, l)
Definition: eval_error.c:8
rb_obj_is_instance_of
VALUE rb_obj_is_instance_of(VALUE, VALUE)
Determines if obj is an instance of c.
Definition: object.c:675
i
uint32_t i
Definition: rb_mjit_min_header-2.7.0.h:5464
rb_execution_context_struct::errinfo
VALUE errinfo
Definition: vm_core.h:875
TAG_MASK
#define TAG_MASK
Definition: vm_core.h:206
rb_get_message
VALUE rb_get_message(VALUE exc)
Definition: error.c:1051
SIGSEGV
#define SIGSEGV
Definition: rb_mjit_min_header-2.7.0.h:2259
TRACE_HEAD
#define TRACE_HEAD
METHOD_VISI_UNDEF
@ METHOD_VISI_UNDEF
Definition: method.h:27
EC_EXEC_TAG
#define EC_EXEC_TAG()
Definition: eval_intern.h:181
rb_print_inaccessible
void rb_print_inaccessible(VALUE klass, ID id, rb_method_visibility_t visi)
Definition: eval_error.c:407
id_status
#define id_status
Definition: internal.h:1588
rb_ec_set_raised
int rb_ec_set_raised(rb_execution_context_t *ec)
Definition: thread.c:2344
EXIT_SUCCESS
#define EXIT_SUCCESS
Definition: error.c:39
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:920
TRACE_TAIL
#define TRACE_TAIL
METHOD_VISI_PROTECTED
@ METHOD_VISI_PROTECTED
Definition: method.h:30
RARRAY_AREF
#define RARRAY_AREF(a, i)
Definition: ruby.h:1101
uint8_t
unsigned char uint8_t
Definition: sha2.h:100
FALSE
#define FALSE
Definition: nkf.h:174
TAG_RETRY
#define TAG_RETRY
Definition: vm_core.h:201
METHOD_VISI_PUBLIC
@ METHOD_VISI_PUBLIC
Definition: method.h:28
rb_str_new_cstr
#define rb_str_new_cstr(str)
Definition: rb_mjit_min_header-2.7.0.h:6117
rb_ec_raised_set
#define rb_ec_raised_set(ec, f)
Definition: eval_intern.h:258
rb_frame_callee
ID rb_frame_callee(void)
The name of the current method.
Definition: eval.c:1199
unknown_longjmp_status
#define unknown_longjmp_status(status)
Definition: eval_error.c:428
CLASS_OF
#define CLASS_OF(v)
Definition: ruby.h:484
T_MODULE
#define T_MODULE
Definition: ruby.h:526
TAG_RAISE
#define TAG_RAISE
Definition: vm_core.h:203
RARRAY_LEN
#define RARRAY_LEN(a)
Definition: ruby.h:1070
buf
unsigned char buf[MIME_BUF_SIZE]
Definition: nkf.c:4322
rb_backtrace_p
int rb_backtrace_p(VALUE obj)
Definition: vm_backtrace.c:446
rb_write_error_str
RUBY_EXTERN void rb_write_error_str(VALUE mesg)
Definition: io.c:7936
UNREACHABLE
#define UNREACHABLE
Definition: ruby.h:63
rb_sprintf
VALUE rb_sprintf(const char *format,...)
Definition: sprintf.c:1197
klass
VALUE klass
Definition: rb_mjit_min_header-2.7.0.h:13254
inaccessible_mesg
#define inaccessible_mesg(v)
Definition: eval_error.c:401
rb_eSysStackError
VALUE rb_eSysStackError
Definition: eval.c:34
rb_print_undef_str
void rb_print_undef_str(VALUE klass, VALUE name)
Definition: eval_error.c:394
str
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
log10
double log10(double)
ruby_escaped_char
const char * ruby_escaped_char(int c)
Definition: string.c:5848
rb_hash_aset
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
Definition: hash.c:2779
NIL_P
#define NIL_P(v)
Definition: ruby.h:482
TAG_NONE
#define TAG_NONE
Definition: vm_core.h:197
TRACE_MAX
#define TRACE_MAX
st
enum ruby_tag_type st
Definition: rb_mjit_min_header-2.7.0.h:11111
err
int err
Definition: win32.c:135
warn_print
#define warn_print(x)
Definition: eval_error.c:17
rb_name_err_raise_str
#define rb_name_err_raise_str(mesg, recv, name)
Definition: internal.h:1572
rb_eException
VALUE rb_eException
Definition: error.c:914
write_warn_str
#define write_warn_str(str, x)
Definition: eval_error.c:22
TAG_NEXT
#define TAG_NEXT
Definition: vm_core.h:200
EC_PUSH_TAG
#define EC_PUSH_TAG(ec)
Definition: eval_intern.h:130
Qtrue
#define Qtrue
Definition: ruby.h:468
rb_str_catf
VALUE rb_str_catf(VALUE str, const char *format,...)
Definition: sprintf.c:1237
rb_get_backtrace
VALUE rb_get_backtrace(VALUE exc)
Definition: error.c:1229
rb_ec_reset_raised
int rb_ec_reset_raised(rb_execution_context_t *ec)
Definition: thread.c:2354
rb_class_name
VALUE rb_class_name(VALUE)
Definition: variable.c:274
CSI_BEGIN
#define CSI_BEGIN
Definition: eval_error.c:123
len
uint8_t len
Definition: escape.c:17
T_STRING
#define T_STRING
Definition: ruby.h:528
TAG_BREAK
#define TAG_BREAK
Definition: vm_core.h:199
NUM2INT
#define NUM2INT(x)
Definition: ruby.h:715
Qnil
#define Qnil
Definition: ruby.h:469
exc
const rb_iseq_t const VALUE exc
Definition: rb_mjit_min_header-2.7.0.h:13504
rb_strlen_lit
#define rb_strlen_lit(str)
Definition: intern.h:913
undef_mesg
#define undef_mesg(v)
Definition: eval_error.c:373
RSTRING_LEN
#define RSTRING_LEN(str)
Definition: ruby.h:1005
TAG_THROW
#define TAG_THROW
Definition: vm_core.h:204
rb_str_cat
VALUE rb_str_cat(VALUE, const char *, long)
Definition: string.c:2812
rb_obj_is_kind_of
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
Definition: object.c:692
CSI_SGR
#define CSI_SGR
Definition: eval_error.c:124
rb_exc_set_backtrace
MJIT_FUNC_EXPORTED VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt)
Definition: error.c:1310
rb_eSystemExit
VALUE rb_eSystemExit
Definition: error.c:915
TAG_RETURN
#define TAG_RETURN
Definition: vm_core.h:198
write_warn
#define write_warn(str, x)
Definition: eval_error.c:6
rb_source_location
VALUE rb_source_location(int *pline)
Definition: vm.c:1360
memchr
void * memchr(const void *, int, size_t)
name
const char * name
Definition: nkf.c:208
rb_execution_context_struct
Definition: vm_core.h:843