summaryrefslogtreecommitdiff
path: root/ext/objspace/objspace_dump.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-11-02 11:03:21 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-11-02 11:03:21 -0400
commit4a8cd9e8bca2be1c14310cc13366ec9177a1f74d (patch)
treee41ec1f6fbdc845b8f1d393d60a99f3cbd4a852c /ext/objspace/objspace_dump.c
parent875b7b3361d6073cfbad6161c595b3640210cb03 (diff)
Use shared flags of the type
The ELTS_SHARED flag is generic, so we should prefer to use the flags specific of the type (STR_SHARED for strings and RARRAY_SHARED_FLAG for arrays).
Diffstat (limited to 'ext/objspace/objspace_dump.c')
-rw-r--r--ext/objspace/objspace_dump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 2917d49331..7c7cae3488 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -14,6 +14,7 @@
#include "gc.h"
#include "internal.h"
+#include "internal/array.h"
#include "internal/hash.h"
#include "internal/string.h"
#include "internal/sanitizers.h"
@@ -456,7 +457,7 @@ dump_object(VALUE obj, struct dump_config *dc)
case T_ARRAY:
dump_append(dc, ", \"length\":");
dump_append_ld(dc, RARRAY_LEN(obj));
- if (RARRAY_LEN(obj) > 0 && FL_TEST(obj, ELTS_SHARED))
+ if (RARRAY_LEN(obj) > 0 && FL_TEST(obj, RARRAY_SHARED_FLAG))
dump_append(dc, ", \"shared\":true");
if (FL_TEST(obj, RARRAY_EMBED_FLAG))
dump_append(dc, ", \"embedded\":true");