* eval.c (call_trace_func): should not call trace function while
compilation. * eval.c (rb_call0): also inside c-func. * parse.y (yycompile): ditto. * ruby.c (require_libraries): preserve source file/line for each require. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3cdd50125
commit
742283385f
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Sun Sep 22 21:49:42 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* eval.c (call_trace_func): should not call trace function while
|
||||||
|
compilation.
|
||||||
|
|
||||||
|
* eval.c (rb_call0): also inside c-func.
|
||||||
|
|
||||||
|
* parse.y (yycompile): ditto.
|
||||||
|
|
||||||
|
* ruby.c (require_libraries): preserve source file/line for each
|
||||||
|
require.
|
||||||
|
|
||||||
Sat Sep 21 22:23:41 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Sat Sep 21 22:23:41 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* eval.c (rb_thread_raise): no need to save dead thread context.
|
* eval.c (rb_thread_raise): no need to save dead thread context.
|
||||||
|
8
eval.c
8
eval.c
@ -895,8 +895,7 @@ void
|
|||||||
ruby_set_current_source()
|
ruby_set_current_source()
|
||||||
{
|
{
|
||||||
if (ruby_current_node) {
|
if (ruby_current_node) {
|
||||||
ruby_sourcefile = ruby_current_node->nd_file;
|
SET_CURRENT_SOURCE();
|
||||||
ruby_sourceline = nd_line(ruby_current_node);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2061,6 +2060,7 @@ call_trace_func(event, node, self, id, klass)
|
|||||||
|
|
||||||
if (!trace_func) return;
|
if (!trace_func) return;
|
||||||
if (tracing) return;
|
if (tracing) return;
|
||||||
|
if (ruby_in_compile) return;
|
||||||
|
|
||||||
node_save[0] = ruby_last_node;
|
node_save[0] = ruby_last_node;
|
||||||
if (!(node_save[1] = ruby_current_node)) {
|
if (!(node_save[1] = ruby_current_node)) {
|
||||||
@ -4501,17 +4501,21 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
|
|||||||
}
|
}
|
||||||
if (trace_func) {
|
if (trace_func) {
|
||||||
int state;
|
int state;
|
||||||
|
NODE *volatile node = ruby_current_node;
|
||||||
|
|
||||||
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
call_trace_func("c-call", ruby_current_node, recv, id, klass);
|
||||||
|
ruby_current_node = 0;
|
||||||
PUSH_TAG(PROT_FUNC);
|
PUSH_TAG(PROT_FUNC);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
||||||
}
|
}
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
ruby_current_node = node;
|
||||||
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
call_trace_func("c-return", ruby_current_node, recv, id, klass);
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
ruby_current_node = 0;
|
||||||
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
parse.y
2
parse.y
@ -2335,6 +2335,7 @@ yycompile(f, line)
|
|||||||
NODE *node = 0;
|
NODE *node = 0;
|
||||||
struct RVarmap *vp, *vars = ruby_dyna_vars;
|
struct RVarmap *vp, *vars = ruby_dyna_vars;
|
||||||
|
|
||||||
|
ruby_in_compile = 1;
|
||||||
if (!compile_for_eval && rb_safe_level() == 0 &&
|
if (!compile_for_eval && rb_safe_level() == 0 &&
|
||||||
rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) {
|
rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) {
|
||||||
VALUE hash, fname;
|
VALUE hash, fname;
|
||||||
@ -2365,7 +2366,6 @@ yycompile(f, line)
|
|||||||
quoted_term = -1;
|
quoted_term = -1;
|
||||||
ruby_current_node = 0;
|
ruby_current_node = 0;
|
||||||
ruby_sourcefile = rb_source_filename(f);
|
ruby_sourcefile = rb_source_filename(f);
|
||||||
ruby_in_compile = 1;
|
|
||||||
n = yyparse();
|
n = yyparse();
|
||||||
ruby_debug_lines = 0;
|
ruby_debug_lines = 0;
|
||||||
compile_for_eval = 0;
|
compile_for_eval = 0;
|
||||||
|
7
ruby.c
7
ruby.c
@ -321,19 +321,20 @@ require_libraries()
|
|||||||
ruby_eval_tree = ruby_eval_tree_begin = 0;
|
ruby_eval_tree = ruby_eval_tree_begin = 0;
|
||||||
req_list_last = 0;
|
req_list_last = 0;
|
||||||
while (list) {
|
while (list) {
|
||||||
|
ruby_current_node = 0;
|
||||||
rb_require(list->name);
|
rb_require(list->name);
|
||||||
tmp = list->next;
|
tmp = list->next;
|
||||||
free(list->name);
|
free(list->name);
|
||||||
free(list);
|
free(list);
|
||||||
list = tmp;
|
list = tmp;
|
||||||
|
ruby_current_node = save[2];
|
||||||
|
ruby_set_current_source();
|
||||||
}
|
}
|
||||||
req_list_head.next = 0;
|
req_list_head.next = 0;
|
||||||
ruby_eval_tree = save[0];
|
ruby_eval_tree = save[0];
|
||||||
ruby_eval_tree_begin = save[1];
|
ruby_eval_tree_begin = save[1];
|
||||||
ruby_current_node = save[2];
|
|
||||||
ruby_set_current_source();
|
|
||||||
ruby_current_node = 0;
|
|
||||||
rb_gc_force_recycle((VALUE)save[2]);
|
rb_gc_force_recycle((VALUE)save[2]);
|
||||||
|
ruby_current_node = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user