File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
llvm/include/llvm/Demangle Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -5203,7 +5203,12 @@ struct FloatData<long double>
5203
5203
#else
5204
5204
static const size_t mangled_size = 20 ; // May need to be adjusted to 16 or 24 on other platforms
5205
5205
#endif
5206
- static const size_t max_demangled_size = 40 ;
5206
+ // `-0x1.ffffffffffffffffffffffffffffp+16383` + 'L' + '\0' == 42 bytes.
5207
+ // 28 'f's * 4 bits == 112 bits, which is the number of mantissa bits.
5208
+ // Negatives are one character longer than positives.
5209
+ // `0x1.` and `p` are constant, and exponents `+16383` and `-16382` are the
5210
+ // same length. 1 sign bit, 112 mantissa bits, and 15 exponent bits == 128.
5211
+ static const size_t max_demangled_size = 42 ;
5207
5212
static constexpr const char *spec = " %LaL" ;
5208
5213
};
5209
5214
Original file line number Diff line number Diff line change 15
15
16
16
// Is long double fp80? (Only x87 extended double has 64-bit mantissa)
17
17
#define LDBL_FP80 (__LDBL_MANT_DIG__ == 64)
18
+ // Is long double fp128?
19
+ #define LDBL_FP128 (__LDBL_MANT_DIG__ == 113)
18
20
19
21
const char* cases[][2] =
20
22
{
@@ -29837,6 +29839,11 @@ struct FPLiteralCase {
29837
29839
"void test0::h<float>(char (&) [(unsigned int)((sizeof (float)) + (0xap-1L))])",
29838
29840
}},
29839
29841
#endif
29842
+ #if LDBL_FP128
29843
+ // This was found by libFuzzer+HWASan on aarch64 Android.
29844
+ {"1\006ILeeeEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE",
29845
+ {"\x6<-0x1.cecececececececececececececep+11983"}},
29846
+ #endif
29840
29847
};
29841
29848
const unsigned NF = sizeof(fp_literal_cases) / sizeof(fp_literal_cases[0]);
29842
29849
const unsigned NEF = sizeof(fp_literal_cases[0].expecting) / sizeof(fp_literal_cases[0].expecting[0]);
Original file line number Diff line number Diff line change @@ -5203,7 +5203,12 @@ struct FloatData<long double>
5203
5203
#else
5204
5204
static const size_t mangled_size = 20 ; // May need to be adjusted to 16 or 24 on other platforms
5205
5205
#endif
5206
- static const size_t max_demangled_size = 40 ;
5206
+ // `-0x1.ffffffffffffffffffffffffffffp+16383` + 'L' + '\0' == 42 bytes.
5207
+ // 28 'f's * 4 bits == 112 bits, which is the number of mantissa bits.
5208
+ // Negatives are one character longer than positives.
5209
+ // `0x1.` and `p` are constant, and exponents `+16383` and `-16382` are the
5210
+ // same length. 1 sign bit, 112 mantissa bits, and 15 exponent bits == 128.
5211
+ static const size_t max_demangled_size = 42 ;
5207
5212
static constexpr const char *spec = " %LaL" ;
5208
5213
};
5209
5214
You can’t perform that action at this time.
0 commit comments