Fix parsing negative int64 of length 19 when double_fallback is enabled
Summary: There was a bug in the logic where negative 18-digit numbers would be incorrectly assessed as not fitting int64_t even though they do. The issue was that `integral.size() < maxIntLen` condition didn't work correctly for some negative numbers. In particular, for 18-digit negative numbers, `integral.size()` would be 19 (minus sign + 18 digits) which is not smaller than `maxIntLen` which is also 19. The subsequent check `(negative && integral.size() == minIntLen && integral <= minInt)` would also fail because `minIntLen` is 20. Reviewed By: yfeldblum Differential Revision: D33732185 fbshipit-source-id: 0ff70387e3b450acf45efc950a9114a13e752386
Showing
Please register or sign in to comment