Skip to content

Commit c8a99bb

Browse files
committed
compiler/natives/src/math/big: Remove bitLen, override Word.
math/big package no longer has a bitLen low-level function, so it can be removed. In Go 1.9, the type of big.Word has changed from uintptr to uint. Due to issue #652 with uint multiplication with overflows, we use a workaround of overriding type of Word back to uintptr. This should be undone once #652 is fixed. Fixes: $ gopherjs test --short math/big $GOROOT/src/math/big/big.go:39:9: undeclared name: bitLen_g
1 parent 15ab3c0 commit c8a99bb

File tree

1 file changed

+7
-3
lines changed
  • compiler/natives/src/math/big

1 file changed

+7
-3
lines changed

compiler/natives/src/math/big/big.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
package big
44

5+
// TODO: This is a workaround for https://github.com/gopherjs/gopherjs/issues/652.
6+
// Remove after that issue is resolved.
7+
type Word uintptr
8+
9+
// TODO: Consider using math_big_pure_go build tag for this package, instead of
10+
// defining all these pure Go low level operators ourselves.
11+
512
func mulWW(x, y Word) (z1, z0 Word) {
613
return mulWW_g(x, y)
714
}
@@ -35,6 +42,3 @@ func addMulVVW(z, x []Word, y Word) (c Word) {
3542
func divWVW(z []Word, xn Word, x []Word, y Word) (r Word) {
3643
return divWVW_g(z, xn, x, y)
3744
}
38-
func bitLen(x Word) (n int) {
39-
return bitLen_g(x)
40-
}

0 commit comments

Comments
 (0)