summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-13 09:34:49 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-13 12:46:48 +0900
commitfce667ed08f25fa7ce43c9b07be170f341a04c4e (patch)
tree56afed76806c5c6793040de5c00f7acc72c30a59 /string.c
parentb1b155ff03634ade5cc0e724529841d354d54033 (diff)
Get rid of warnings/exceptions at cleanup
After the encoding index instance variable is removed when all instance variables are removed in `obj_free`, then `rb_str_free` causes uninitialized instance variable warning and nil-to-integer conversion exception. Both cases result in object allocation during GC, and crashes.
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 3cfe3adcac..28a1b293d6 100644
--- a/string.c
+++ b/string.c
@@ -181,6 +181,7 @@ VALUE rb_cSymbol;
#define STR_HEAP_PTR(str) (RSTRING(str)->as.heap.ptr)
#define STR_HEAP_SIZE(str) ((size_t)RSTRING(str)->as.heap.aux.capa + TERM_LEN(str))
+/* TODO: include the terminator size in capa. */
#define STR_ENC_GET(str) get_encoding(str)