summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-11 00:36:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-11 00:36:38 +0000
commit91d884b86e3cd51962360eea8db2307c0ad61678 (patch)
tree690072aaad89d58629f353967741bc52142bf408
parentd1bdb139ea33ba0248c15c62eb4e18ecb491bd12 (diff)
* 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
-rw-r--r--ChangeLog8
-rw-r--r--eval.c18
-rw-r--r--marshal.c4
-rw-r--r--version.h4
4 files changed, 23 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 86647640c1..ebab6a63a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>.
diff --git a/eval.c b/eval.c
index 47ecfa6493..4a1aaefdaa 100644
--- a/eval.c
+++ b/eval.c
@@ -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);
diff --git a/marshal.c b/marshal.c
index 24eacc4b13..9bed4296fc 100644
--- a/marshal.c
+++ b/marshal.c
@@ -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;
diff --git a/version.h b/version.h
index cb892361d5..622e22f49b 100644
--- a/version.h
+++ b/version.h
@@ -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