Skip to content

math/big: don't force second arg to Jacobi and Int.ModSqrt to escape#50527

Closed
nvb wants to merge 1 commit intogolang:masterfrom
nvb:jacobi-escape
Closed

math/big: don't force second arg to Jacobi and Int.ModSqrt to escape#50527
nvb wants to merge 1 commit intogolang:masterfrom
nvb:jacobi-escape

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Jan 9, 2022

This CL updates big.Jacobi to avoid forcing its y argument to escape
to the heap. The argument was escaping because it was being passed
through an empty interface to fmt.Sprintf during an assertion failure.
As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi)
could not keep this value on the stack.

Noticed when working on cockroachdb/apd#103.

This CL updates big.Jacobi to avoid forcing its y argument to escape
to the heap. The argument was escaping because it was being passed
through an empty interface to fmt.Sprintf during an assertion failure.
As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi)
could not keep this value on the stack.

Noticed when working on cockroachdb/apd#103.
@gopherbot
Copy link
Copy Markdown
Contributor

This PR (HEAD: 3ee07b5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/377014 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Robert Griesemer:

Patch Set 1: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 1: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Robert Griesemer:

Patch Set 1: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Robert Griesemer:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Filippo Valsorda:

Patch Set 1: Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Patch Set 1 was rebased


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Ian Lance Taylor:

Patch Set 2: Run-TryBot+1 Auto-Submit+1 Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 2: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/377014.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request May 8, 2022
This CL updates big.Jacobi to avoid forcing its y argument to escape
to the heap. The argument was escaping because it was being passed
through an empty interface to fmt.Sprintf during an assertion failure.
As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi)
could not keep this value on the stack.

Noticed when working on cockroachdb/apd#103.

Change-Id: I5db9ee2149bf13b921886929425861721b53b085
GitHub-Last-Rev: 3ee07b5
GitHub-Pull-Request: #50527
Reviewed-on: https://go-review.googlesource.com/c/go/+/377014
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
@gopherbot
Copy link
Copy Markdown
Contributor

This PR is being closed because golang.org/cl/377014 has been merged.

@gopherbot gopherbot closed this May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants