From: "mrkn (Kenta Murata)" Date: 2013-12-13T02:18:35+09:00 Subject: [ruby-core:59076] [ruby-trunk - Bug #7371][Closed] Fix undefined overflow checking in bigdecimal Issue #7371 has been updated by mrkn (Kenta Murata). Status changed from Assigned to Closed I think this issue had been fixed by akr in r40214. ---------------------------------------- Bug #7371: Fix undefined overflow checking in bigdecimal https://bugs.ruby-lang.org/issues/7371#change-43629 Author: xi (Xi Wang) Status: Closed Priority: Normal Assignee: mrkn (Kenta Murata) Category: ext Target version: ruby -v: 1.9.x Backport: In AddExponent() at ext/bigdecimal/bigdecimal.c:3677, the overflow checks rely on signed integer overflow, which is undefined behavior in C. SIGNED_VALUE m = e+n; SIGNED_VALUE eb, mb; if(e>0) { if(n>0) { mb = m*(SIGNED_VALUE)BASE_FIG; eb = e*(SIGNED_VALUE)BASE_FIG; if(mb