@@ -567,11 +567,13 @@ lldb::offset_t lldb_private::DumpDataExtractor(
567
567
size_t item_bit_size = item_byte_size * 8 ;
568
568
569
569
if (item_bit_size == ast->getTypeSize (ast->FloatTy )) {
570
- llvm::APInt apint (item_bit_size,
571
- DE.GetMaxU64 (&offset, item_byte_size));
572
- llvm::APFloat apfloat (ast->getFloatTypeSemantics (ast->FloatTy ),
573
- apint);
574
- apfloat.toString (sv, format_precision, format_max_padding);
570
+ llvm::Optional<llvm::APInt> apint =
571
+ GetAPInt (DE, &offset, item_byte_size);
572
+ if (apint.hasValue ()) {
573
+ llvm::APFloat apfloat (ast->getFloatTypeSemantics (ast->FloatTy ),
574
+ apint.getValue ());
575
+ apfloat.toString (sv, format_precision, format_max_padding);
576
+ }
575
577
} else if (item_bit_size == ast->getTypeSize (ast->DoubleTy )) {
576
578
llvm::Optional<llvm::APInt> apint =
577
579
GetAPInt (DE, &offset, item_byte_size);
@@ -595,10 +597,13 @@ lldb::offset_t lldb_private::DumpDataExtractor(
595
597
apfloat.toString (sv, format_precision, format_max_padding);
596
598
}
597
599
} else if (item_bit_size == ast->getTypeSize (ast->HalfTy )) {
598
- llvm::APInt apint (item_bit_size, DE.GetU16 (&offset));
599
- llvm::APFloat apfloat (ast->getFloatTypeSemantics (ast->HalfTy ),
600
- apint);
601
- apfloat.toString (sv, format_precision, format_max_padding);
600
+ llvm::Optional<llvm::APInt> apint =
601
+ GetAPInt (DE, &offset, item_byte_size);
602
+ if (apint.hasValue ()) {
603
+ llvm::APFloat apfloat (ast->getFloatTypeSemantics (ast->HalfTy ),
604
+ apint.getValue ());
605
+ apfloat.toString (sv, format_precision, format_max_padding);
606
+ }
602
607
}
603
608
604
609
if (!sv.empty ()) {
0 commit comments