diff options
author | Jonathan Calvert <[email protected]> | 2024-09-06 22:19:47 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-07 12:19:47 +0900 |
commit | c1a510a8dffa1c8065e47697cd57edae67126712 (patch) | |
tree | b5119434bd9642690354f87c6d36fa4627642119 | |
parent | 6dc93846943a0fc85e597fd16c653de6fd7f35d7 (diff) |
[Bug #20718] Free non-`RTypedData` objects
Allow objects that are not of type `RTypedData` to use the default
free function, as `RTYPEDDATA_EMBEDDED_P` can return a false positive
when casting non-`RTypedData` objects.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11563
Merged-By: nobu <[email protected]>
-rw-r--r-- | gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1051,7 +1051,7 @@ rb_data_free(void *objspace, VALUE obj) if (dfree) { if (dfree == RUBY_DEFAULT_FREE) { - if (!RTYPEDDATA_EMBEDDED_P(obj)) { + if (!RTYPEDDATA_P(obj) || !RTYPEDDATA_EMBEDDED_P(obj)) { xfree(data); RB_DEBUG_COUNTER_INC(obj_data_xfree); } |