Index: runtime/vm/snapshot.cc |
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc |
index 016465ab74358eeb10683528c0766a82c18607a7..13511a2fd3435a96ef50a264342b44cb27976043 100644 |
--- a/runtime/vm/snapshot.cc |
+++ b/runtime/vm/snapshot.cc |
@@ -2,6 +2,8 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
+#include <openssl/crypto.h> |
+ |
#include "vm/snapshot.h" |
#include "platform/assert.h" |
@@ -539,6 +541,23 @@ void MessageWriter::WriteCObject(Dart_CObject* object) { |
WriteSmi(object->value.as_int32); |
break; |
} |
+ case Dart_CObject::kBigint: { |
+ // Write out the serialization header value for this object. |
+ WriteInlinedHeader(object); |
+ // Write out the class and tags information. |
+ WriteObjectHeader(ObjectStore::kBigintClass, 0); |
+ BIGNUM* bn = BN_new(); |
+ BN_dec2bn(&bn, object->value.as_bigint); |
+ char* hex_string = BN_bn2hex(bn); |
siva
2012/02/09 01:47:27
Somebody came up with the BigintOperations class i
Søren Gjesse
2012/02/09 14:08:33
After changing to using the hex format for the dat
|
+ intptr_t len = strlen(hex_string); |
+ WriteIntptrValue(len); |
+ for (intptr_t i = 0; i < len; i++) { |
+ Write<uint8_t>(hex_string[i]); |
+ } |
+ OPENSSL_free(hex_string); |
+ BN_free(bn); |
+ break; |
+ } |
case Dart_CObject::kDouble: |
// Write out the serialization header value for this object. |
WriteInlinedHeader(object); |