Index: runtime/vm/raw_object_snapshot.cc |
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc |
index 7b515c5742bb93746fc763cf0a723c13f9979ee9..5aeac65760eb84d57cce653246eb8d681d00ead2 100644 |
--- a/runtime/vm/raw_object_snapshot.cc |
+++ b/runtime/vm/raw_object_snapshot.cc |
@@ -1177,8 +1177,15 @@ void RawBigint::WriteTo(SnapshotWriter* writer, |
// Write out the bigint value as a HEXCstring. |
ptr()->bn_.d = ptr()->data_; |
const char* str = BigintOperations::ToHexCString(&ptr()->bn_, &ZoneAllocator); |
+ bool neg = false; |
+ if (*str == '-') { |
+ neg = true; |
+ str++; |
+ } |
intptr_t len = strlen(str); |
- writer->WriteIntptrValue(len-2); |
+ ASSERT(len > 2 && str[0] == '0' && str[1] == 'x'); |
+ writer->WriteIntptrValue(len - 2 + (neg ? 1 : 0)); |
+ if (neg) writer->Write<uint8_t>('-'); |
siva
2012/02/09 01:47:27
Could you restruct as follows to make it more clea
Søren Gjesse
2012/02/09 14:08:33
Done.
|
for (intptr_t i = 2; i < len; i++) { |
writer->Write<uint8_t>(str[i]); |
} |