This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
forked from google/starlark-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Immutability of Int is broken by BigInt method (google#332) (goo…
…gle#333) * Fix: Immutability of Int is broken by BigInt method (google#332) The interface of Int assumes the value is immutable but a reference to its content is leaked through the BigInt() method, which is mutable. This fix resolves the leak by: - making a copy of the *big.Int in MakeBigInt() - returning a copy of the *big.Int content in BigInt() - creating an internal method bigInt() for internal use that still returns reference to the internal big.Int Fixes: google#332 * Fix: Immutability of Int is broken by BigInt method (google#332) Addressing review comments regarding documentation Fixes: google#332
- Loading branch information
1 parent
8756d3e
commit b6d3e7f
Showing
2 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters