ruby-changes:60778
From: Nobuyoshi <ko1@a...>
Date: Wed, 15 Apr 2020 12:23:16 +0900 (JST)
Subject: [ruby-changes:60778] f9822d1738 (master): Shrink diassembled result string
https://git.ruby-lang.org/ruby.git/commit/?id=f9822d1738 From f9822d173842d758d7ec4180be7addba30422e40 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 15 Apr 2020 12:17:45 +0900 Subject: Shrink diassembled result string diff --git a/iseq.c b/iseq.c index 0488735..9a6dad3 100644 --- a/iseq.c +++ b/iseq.c @@ -2307,7 +2307,9 @@ rb_iseq_disasm_recursive(const rb_iseq_t *iseq, VALUE indent) https://github.com/ruby/ruby/blob/trunk/iseq.c#L2307 VALUE rb_iseq_disasm(const rb_iseq_t *iseq) { - return rb_iseq_disasm_recursive(iseq, rb_str_new(0, 0)); + VALUE str = rb_iseq_disasm_recursive(iseq, rb_str_new(0, 0)); + rb_str_resize(str, RSTRING_LEN(str)); + return str; } /* -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/