We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f56c4b5 + b3a1134 commit 1bc4240Copy full SHA for 1bc4240
src/fread.c
@@ -927,10 +927,13 @@ static void parse_double_hexadecimal(FieldParseContext *ctx)
927
if (neg) ch++;
928
else if (*ch == '+') ch++;
929
930
- const bool subnormal = ch[2] == '0';
+ bool subnormal = false;
931
932
+ // Important!
933
+ // Keep in mind that only ch[0] is guaranteed to be mapped.
934
+ // Rearranging these checks (e.g. to make 'subnormal' const) will lead to segfaults in rare cases.
935
if (ch[0] == '0' && (ch[1] == 'x' || ch[1] == 'X') &&
- (ch[2] == '1' || (subnormal)) && ch[3] == '.') {
936
+ (ch[2] == '1' || (subnormal = (ch[2] == '0'))) && ch[3] == '.') {
937
ch += 4;
938
uint64_t acc = 0;
939
uint8_t digit;
0 commit comments