summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--variable.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/variable.c b/variable.c
index 144f943618..7477006370 100644
--- a/variable.c
+++ b/variable.c
@@ -1494,12 +1494,7 @@ rb_copy_generic_ivar(VALUE clone, VALUE obj)
rb_check_frozen(clone);
if (!FL_TEST(obj, FL_EXIVAR)) {
- clear:
- if (FL_TEST(clone, FL_EXIVAR)) {
- rb_free_generic_ivar(clone);
- FL_UNSET(clone, FL_EXIVAR);
- }
- return;
+ goto clear;
}
if (gen_ivtbl_get(obj, &ivtbl)) {
struct givar_copy c;
@@ -1526,6 +1521,13 @@ rb_copy_generic_ivar(VALUE clone, VALUE obj)
*/
st_insert(generic_iv_tbl, (st_data_t)clone, (st_data_t)c.ivtbl);
}
+ return;
+
+ clear:
+ if (FL_TEST(clone, FL_EXIVAR)) {
+ rb_free_generic_ivar(clone);
+ FL_UNSET(clone, FL_EXIVAR);
+ }
}
void