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

Issue 6611056: code review 6611056: runtime: fix a panic when growing zero-width-element slices. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by remyoudompheng
Modified:
11 years, 6 months ago
Reviewers:
CC:
golang-dev, r
Visibility:
Public.

Description

runtime: fix a panic when growing zero-width-element slices. Fixes issue 4197.

Patch Set 1 #

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

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

Total comments: 2

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

Patch Set 5 : diff -r b19c6b32c8da https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -1 line) Patch
M src/pkg/runtime/slice.c View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
A test/fixedbugs/bug457.go View 1 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 3
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 6 months ago (2012-10-06 08:39:09 UTC) #1
r
LGTM http://codereview.appspot.com/6611056/diff/4003/src/pkg/runtime/slice.c File src/pkg/runtime/slice.c (right): http://codereview.appspot.com/6611056/diff/4003/src/pkg/runtime/slice.c#newcode117 src/pkg/runtime/slice.c:117: if((intgo)cap != cap || cap < old.cap || ...
11 years, 6 months ago (2012-10-06 09:25:08 UTC) #2
remyoudompheng
11 years, 6 months ago (2012-10-06 10:06:00 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=77ff7047ad16 ***

runtime: fix a panic when growing zero-width-element slices.

Fixes issue 4197.

R=golang-dev, r
CC=golang-dev
http://codereview.appspot.com/6611056

http://codereview.appspot.com/6611056/diff/4003/src/pkg/runtime/slice.c
File src/pkg/runtime/slice.c (right):

http://codereview.appspot.com/6611056/diff/4003/src/pkg/runtime/slice.c#newco...
src/pkg/runtime/slice.c:117: if((intgo)cap != cap || cap < old.cap ||
t->elem->size > 0 && cap > MaxMem / t->elem->size)
On 2012/10/06 09:25:08, r wrote:
> parens wouldn't hurt.

Done.
Sign in to reply to this message.

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