Skip to content

Commit ceed619

Browse files
authored
Fix negative integer printing (#17)
1 parent 3ea7345 commit ceed619

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/source/Core/DumpDataExtractor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ static offset_t FormatOCamlValue(const DataExtractor &DE, Stream *s,
438438

439439
if ((value & 0x1) == 1) {
440440
/* Tagged immediate */
441-
s->Printf("%" PRId64, value >> 1);
441+
// Convert to signed int64_t to handle negative values correctly
442+
int64_t signed_value = static_cast<int64_t>(value);
443+
s->Printf("%" PRId64, signed_value >> 1);
442444
} else if (pointers_seen.contains(value)) {
443445
s->Printf("<cyclic value>@");
444446
} else {

0 commit comments

Comments
 (0)