| Index: src/zone-inl.h
|
| diff --git a/src/zone-inl.h b/src/zone-inl.h
|
| index 6e2d558a60625a1fb055c6a5c52ffd5bc44ec622..4870105f318bdffc94ce9cc5e55556c81e321d36 100644
|
| --- a/src/zone-inl.h
|
| +++ b/src/zone-inl.h
|
| @@ -55,7 +55,12 @@ inline void* Zone::New(int size) {
|
|
|
| // Check if the requested size is available without expanding.
|
| Address result = position_;
|
| - if ((position_ += size) > limit_) result = NewExpand(size);
|
| +
|
| + if (size > limit_ - position_) {
|
| + result = NewExpand(size);
|
| + } else {
|
| + position_ += size;
|
| + }
|
|
|
| // Check that the result has the proper alignment and return it.
|
| ASSERT(IsAddressAligned(result, kAlignment, 0));
|
|
|