summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2022-12-07 16:01:37 +0000
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-09 22:11:00 +0900
commit181d4bee5e03a30596e78b2d7aa0396887a53881 (patch)
treeb7357b6f4faa53ff7150b4c63eee23d6a9c010d5 /object.c
parent7c438328d59e70fee82100caaa931ff163bd8daf (diff)
Use rb_inspect instead of +PRIsVALUE for Object.inspect
In order to preserve the values when TrueClass, FalseClass or NilClass are stored in ivars
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6872
Diffstat (limited to 'object.c')
-rw-r--r--object.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/object.c b/object.c
index 83f2e42555..73528fe935 100644
--- a/object.c
+++ b/object.c
@@ -677,8 +677,8 @@ inspect_i(st_data_t k, st_data_t v, st_data_t a)
else {
rb_str_cat2(str, ", ");
}
- rb_str_catf(str, "%"PRIsVALUE"=%+"PRIsVALUE,
- rb_id2str(id), value);
+ rb_str_catf(str, "%"PRIsVALUE"=", rb_id2str(id));
+ rb_str_buf_append(str, rb_inspect(value));
return ST_CONTINUE;
}