Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13)

Issue 5437081: code review 5437081: math/big: fix destination leak into result value

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 8 months ago by rog
Modified:
13 years, 8 months ago
Reviewers:
gri
CC:
rsc, gri, golang-dev
Visibility:
Public.

Description

math/big: fix destination leak into result value This code would panic: z := big.NewInt(1) z.SetBit(big.NewInt(0), 2, 1) if z.Cmp(big.NewInt(1<<2)) != 0 { panic("fail") }

Patch Set 1 #

Patch Set 2 : diff -r c5f4de48505f https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r c5f4de48505f https://go.googlecode.com/hg/ #

Total comments: 7

Patch Set 4 : diff -r c5f4de48505f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -4 lines) Patch
M src/pkg/math/big/int_test.go View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M src/pkg/math/big/nat.go View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 5
rog
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 8 months ago (2011-11-29 18:11:28 UTC) #1
gri
http://codereview.appspot.com/5437081/diff/1002/src/pkg/math/big/int_test.go File src/pkg/math/big/int_test.go (right): http://codereview.appspot.com/5437081/diff/1002/src/pkg/math/big/int_test.go#newcode1251 src/pkg/math/big/int_test.go:1251: t.Errorf("destination value not leaked into result value; got %s ...
13 years, 8 months ago (2011-11-29 18:31:04 UTC) #2
rog
PTAL (also made a minor change to make a test print consistent) http://codereview.appspot.com/5437081/diff/1002/src/pkg/math/big/int_test.go File src/pkg/math/big/int_test.go ...
13 years, 8 months ago (2011-11-30 08:55:46 UTC) #3
gri
LGTM thx for fixing this! - gri
13 years, 8 months ago (2011-11-30 17:29:14 UTC) #4
gri
13 years, 8 months ago (2011-11-30 17:30:02 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=ff02633361cd ***

math/big: fix destination leak into result value
This code would panic:
z := big.NewInt(1)
z.SetBit(big.NewInt(0), 2, 1)
if z.Cmp(big.NewInt(1<<2)) != 0 {
        panic("fail")
}

R=rsc, gri
CC=golang-dev
http://codereview.appspot.com/5437081

Committer: Robert Griesemer <gri@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b