These 3 calls:
|
RB_GC_GUARD(dv.bigdecimal); |
|
RB_GC_GUARD(md.bigdecimal); |
|
RB_GC_GUARD(res.bigdecimal); |
call RB_GC_GUARD() on variables which might be uninitialized and so contain garbage values.
This seems to apparently work fine on CRuby, but reading the docs I am not sure it is a correct usage.
It seems unusual to do this.
On TruffleRuby this caused transient errors: truffleruby/truffleruby#4274
Probably this is something we can improve in TruffleRuby, OTOH this is I think the first extension we notice doing this.
Given the code is just:
|
Done: |
|
RB_GC_GUARD(a.bigdecimal); |
|
RB_GC_GUARD(b.bigdecimal); |
|
RB_GC_GUARD(dv.bigdecimal); |
|
RB_GC_GUARD(md.bigdecimal); |
|
RB_GC_GUARD(res.bigdecimal); |
|
return true; |
One fix would be to replace goto Done; with the guard + return true, but omit the guards for unitialized variables at that point.
Or, the variables could be always initialized.
These 3 calls:
bigdecimal/ext/bigdecimal/bigdecimal.c
Lines 1742 to 1744 in 4f93954
call RB_GC_GUARD() on variables which might be uninitialized and so contain garbage values.
This seems to apparently work fine on CRuby, but reading the docs I am not sure it is a correct usage.
It seems unusual to do this.
On TruffleRuby this caused transient errors: truffleruby/truffleruby#4274
Probably this is something we can improve in TruffleRuby, OTOH this is I think the first extension we notice doing this.
Given the code is just:
bigdecimal/ext/bigdecimal/bigdecimal.c
Lines 1739 to 1745 in 4f93954
One fix would be to replace
goto Done;with the guard +return true, but omit the guards for unitialized variables at that point.Or, the variables could be always initialized.