diff --git a/ChangeLog b/ChangeLog index 5eac303039..e6c5b83a8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -Tue Oct 12 23:03:20 2010 Nobuyoshi Nakada +Tue Oct 12 23:09:24 2010 Nobuyoshi Nakada + + * gc.c (obj_free, rb_objspace_call_finalizer): fix truncating + cast. * gc.c (mark_current_machine_context): suppress warnings. diff --git a/gc.c b/gc.c index f4ee76d365..b7343fb420 100644 --- a/gc.c +++ b/gc.c @@ -2190,7 +2190,7 @@ obj_free(rb_objspace_t *objspace, VALUE obj) if (RTYPEDDATA_P(obj)) { RDATA(obj)->dfree = RANY(obj)->as.typeddata.type->function.dfree; } - if ((long)RANY(obj)->as.data.dfree == -1) { + if (RANY(obj)->as.data.dfree == (RUBY_DATA_FUNC)-1) { xfree(DATA_PTR(obj)); } else if (RANY(obj)->as.data.dfree) { @@ -2908,7 +2908,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace) if (RTYPEDDATA_P(p)) { RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree; } - if ((long)RANY(p)->as.data.dfree == -1) { + if (RANY(p)->as.data.dfree == (RUBY_DATA_FUNC)-1) { xfree(DATA_PTR(p)); } else if (RANY(p)->as.data.dfree) {