diff options
| author | Jonathan Calvert <athemeus@athemeus.com> | 2024-09-10 19:38:48 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-10 17:38:48 -0700 |
| commit | 55ddfd58dd6e67e88cf9a3e55bf99550affe8b3f (patch) | |
| tree | 972439a9c4e3f2c7f57865c3dd28aa990e675e39 | |
| parent | 948ca04a76c0031d17798f79fe3bbc5fb8462e90 (diff) | |
Fixes [Bug #20718] (#11576)
Fixes [Bug #20718]
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
| -rw-r--r-- | gc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3491,7 +3491,7 @@ rb_data_free(rb_objspace_t *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); } |
