dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] use %+PRIsVALUE instead of rb_inspect
@ 2015-06-17 20:55 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-06-17 20:55 UTC (permalink / raw)
  To: spew

---
 compile.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/compile.c b/compile.c
index 73d50dc..76c8a07 100644
--- a/compile.c
+++ b/compile.c
@@ -5656,7 +5656,6 @@ get_exception_sym2type(VALUE sym)
 {
 #undef rb_intern
 #define rb_intern(str) rb_intern_const(str)
-    VALUE sym_inspect;
     static VALUE symRescue, symEnsure, symRetry;
     static VALUE symBreak, symRedo, symNext;
 
@@ -5675,9 +5674,7 @@ get_exception_sym2type(VALUE sym)
     if (sym == symBreak)  return CATCH_TYPE_BREAK;
     if (sym == symRedo)   return CATCH_TYPE_REDO;
     if (sym == symNext)   return CATCH_TYPE_NEXT;
-    sym_inspect = rb_inspect(sym);
-    rb_raise(rb_eSyntaxError, "invalid exception symbol: %s",
-	     StringValuePtr(sym_inspect));
+    rb_raise(rb_eSyntaxError, "invalid exception symbol: %+"PRIsVALUE, sym);
     return 0;
 }
 
@@ -5829,8 +5826,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, struct list_head *anchor,
 	    if (st_lookup(insn_table, (st_data_t)insn, &insn_id) == 0) {
 		/* TODO: exception */
 		rb_compile_error(RSTRING_PTR(iseq->location.path), line_no,
-				 "unknown instruction: %"PRIsVALUE,
-				 rb_inspect(insn));
+				 "unknown instruction: %+"PRIsVALUE, insn);
 	    }
 
 	    if (argc != insn_len((VALUE)insn_id)-1) {
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-17 20:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 20:55 [PATCH] use %+PRIsVALUE instead of rb_inspect Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).