* eval.c (rb_eval): set line number from all nodes.

* eval.c (proc_to_s): show source file/line if available.

* marshal.c (r_object): register TYPE_BIGNUM regardless real type.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-08-11 00:36:38 +00:00
Родитель d1bdb139ea
Коммит 91d884b86e
4 изменённых файлов: 23 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Sun Aug 11 09:34:07 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* eval.c (rb_eval): set line number from all nodes.
* eval.c (proc_to_s): show source file/line if available.
* marshal.c (r_object): register TYPE_BIGNUM regardless real type.
Fri Aug 9 13:31:40 2002 WATANABE Hirofumi <eban@ruby-lang.org> Fri Aug 9 13:31:40 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/Win32API/extconf.rb: check existence of <windows.h>. * ext/Win32API/extconf.rb: check existence of <windows.h>.

18
eval.c
Просмотреть файл

@ -2209,6 +2209,7 @@ rb_eval(self, n)
again: again:
if (!node) RETURN(Qnil); if (!node) RETURN(Qnil);
ruby_sourceline = nd_line(node);
switch (nd_type(node)) { switch (nd_type(node)) {
case NODE_BLOCK: case NODE_BLOCK:
while (node->nd_next) { while (node->nd_next) {
@ -2294,7 +2295,6 @@ rb_eval(self, n)
RETURN(Qfalse); RETURN(Qfalse);
case NODE_IF: case NODE_IF:
ruby_sourceline = nd_line(node);
if (trace_func) { if (trace_func) {
call_trace_func("line", node->nd_file, ruby_sourceline, self, call_trace_func("line", node->nd_file, ruby_sourceline, self,
ruby_frame->last_func, ruby_frame->last_func,
@ -2397,7 +2397,6 @@ rb_eval(self, n)
result = Qnil; result = Qnil;
switch (state = EXEC_TAG()) { switch (state = EXEC_TAG()) {
case 0: case 0:
ruby_sourceline = nd_line(node);
if (node->nd_state && !RTEST(rb_eval(self, node->nd_cond))) if (node->nd_state && !RTEST(rb_eval(self, node->nd_cond)))
goto while_out; goto while_out;
do { do {
@ -2430,7 +2429,6 @@ rb_eval(self, n)
result = Qnil; result = Qnil;
switch (state = EXEC_TAG()) { switch (state = EXEC_TAG()) {
case 0: case 0:
ruby_sourceline = nd_line(node);
if (node->nd_state && RTEST(rb_eval(self, node->nd_cond))) if (node->nd_state && RTEST(rb_eval(self, node->nd_cond)))
goto until_out; goto until_out;
do { do {
@ -3075,7 +3073,6 @@ rb_eval(self, n)
break; break;
case NODE_EVSTR: case NODE_EVSTR:
ruby_sourceline = nd_line(node);
result = rb_obj_as_string(rb_eval(self, node->nd_body)); result = rb_obj_as_string(rb_eval(self, node->nd_body));
break; break;
@ -6622,11 +6619,20 @@ proc_to_s(self, other)
{ {
struct BLOCK *data; struct BLOCK *data;
char *cname = rb_class2name(CLASS_OF(self)); char *cname = rb_class2name(CLASS_OF(self));
long len = strlen(cname)+6+16+1; /* 6:tags 16:addr 1:nul */
VALUE str; VALUE str;
Data_Get_Struct(self, struct BLOCK, data); Data_Get_Struct(self, struct BLOCK, data);
str = rb_str_new(0, strlen(cname)+6+16+1); /* 6:tags 16:addr 1:nul */ if (data->body) {
sprintf(RSTRING(str)->ptr, "#<%s:0x%p>", cname, data->tag); len += strlen(data->body->nd_file)+16;
str = rb_str_new(0, len);
sprintf(RSTRING(str)->ptr, "#<%s:0x%p@%s:%d>", cname, data->tag,
data->body->nd_file, nd_line(data->body));
}
else {
str = rb_str_new(0, len);
sprintf(RSTRING(str)->ptr, "#<%s:0x%p>", cname, data->tag);
}
RSTRING(str)->len = strlen(RSTRING(str)->ptr); RSTRING(str)->len = strlen(RSTRING(str)->ptr);
if (OBJ_TAINTED(self)) OBJ_TAINT(str); if (OBJ_TAINTED(self)) OBJ_TAINT(str);

Просмотреть файл

@ -922,9 +922,7 @@ r_object(arg)
#endif #endif
} }
v = rb_big_norm((VALUE)big); v = rb_big_norm((VALUE)big);
if (TYPE(v) == T_BIGNUM) { r_regist(v, arg);
r_regist(v, arg);
}
} }
break; break;

Просмотреть файл

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.2" #define RUBY_VERSION "1.7.2"
#define RUBY_RELEASE_DATE "2002-08-06" #define RUBY_RELEASE_DATE "2002-08-11"
#define RUBY_VERSION_CODE 172 #define RUBY_VERSION_CODE 172
#define RUBY_RELEASE_CODE 20020806 #define RUBY_RELEASE_CODE 20020811