[前][次][番号順一覧][スレッド一覧]

ruby-changes:26277

From: naruse <ko1@a...>
Date: Wed, 12 Dec 2012 09:44:11 +0900 (JST)
Subject: [ruby-changes:26277] naruse:r38334 (trunk): Experimental fix for r38041

naruse	2012-12-12 09:42:26 +0900 (Wed, 12 Dec 2012)

  New Revision: 38334

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38334

  Log:
    Experimental fix for r38041

  Modified files:
    trunk/vm_dump.c

Index: vm_dump.c
===================================================================
--- vm_dump.c	(revision 38333)
+++ vm_dump.c	(revision 38334)
@@ -675,14 +675,15 @@
     if (vm) {
 	int i;
 	VALUE name;
-	long len;
-	const int max_name_length = 1024;
-# define LIMITED_NAME_LENGTH(s) \
-	(((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)
 
 	name = vm->progname;
-	fprintf(stderr, "* Loaded script: %s\n",
-		RSTRING_PTR(name));
+	if (RB_TYPE_P(name, T_STRING)) {
+	    fprintf(stderr, "* Loaded script: %s\n", RSTRING_PTR(name));
+	}
+	else {
+	    fprintf(stderr, "* Loaded script: #<%s:%p>\n",
+		    rb_class2name(CLASS_OF(name)), (void *)name);
+	}
 	fprintf(stderr, "\n");
 	fprintf(stderr, "* Loaded features:\n\n");
 	for (i=0; i<RARRAY_LEN(vm->loaded_features); i++) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]