1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
parent d1bdb139ea
commit 91d884b86e
4 changed files with 23 additions and 11 deletions

View file

@ -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>
* ext/Win32API/extconf.rb: check existence of <windows.h>.

18
eval.c
View file

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

View file

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

View file

@ -1,4 +1,4 @@
#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_RELEASE_CODE 20020806
#define RUBY_RELEASE_CODE 20020811