| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 15309)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -9283,7 +9283,7 @@
|
| }
|
|
|
|
|
| -RawInteger* Integer::AsInteger() const {
|
| +RawInteger* Integer::AsValidInteger() const {
|
| if (IsSmi()) return raw();
|
| if (IsMint()) {
|
| Mint& mint = Mint::Handle();
|
| @@ -9402,7 +9402,7 @@
|
| const Bigint& right_big = Bigint::Handle(other.AsBigint());
|
| const Bigint& result =
|
| Bigint::Handle(left_big.ArithmeticOp(operation, right_big));
|
| - return Integer::Handle(result.AsInteger()).raw();
|
| + return Integer::Handle(result.AsValidInteger()).raw();
|
| }
|
|
|
|
|
| @@ -9873,15 +9873,13 @@
|
|
|
|
|
| RawBigint* Bigint::New(const String& str, Heap::Space space) {
|
| - return BigintOperations::NewFromCString(str.ToCString(), space);
|
| + const Bigint& result = Bigint::Handle(
|
| + BigintOperations::NewFromCString(str.ToCString(), space));
|
| + ASSERT(!BigintOperations::FitsIntoMint(result));
|
| + return result.raw();
|
| }
|
|
|
|
|
| -RawBigint* Bigint::New(int64_t value, Heap::Space space) {
|
| - return BigintOperations::NewFromInt64(value, space);
|
| -}
|
| -
|
| -
|
| double Bigint::AsDoubleValue() const {
|
| return Double::Handle(BigintOperations::ToDouble(*this)).value();
|
| }
|
|
|