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

Issue 12420044: code review 12420044: text/template/parse, html/template: copy Tree.Text duri... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by josharian
Modified:
10 years, 7 months ago
Reviewers:
r
CC:
golang-dev, r
Visibility:
Public.

Description

text/template/parse, html/template: copy Tree.Text during html template clone The root cause of the panic reported in https://code.google.com/p/go/issues/detail?id=5980 is that parse's Tree.Text wasn't being copied during the clone. Note that this fix newly exports Tree.Text. The only alternative fix that does not involve API additions is to significantly degrade error messages. Fixes issue 5980.

Patch Set 1 #

Patch Set 2 : diff -r 6423f26d0193 https://code.google.com/p/go #

Patch Set 3 : diff -r 6423f26d0193 https://code.google.com/p/go #

Patch Set 4 : diff -r 0539958c11bb https://code.google.com/p/go #

Patch Set 5 : diff -r 0539958c11bb https://code.google.com/p/go #

Patch Set 6 : diff -r 0539958c11bb https://code.google.com/p/go #

Patch Set 7 : code review 12420044: text/template/parse, html/template: copy Tree.text duri... #

Patch Set 8 : diff -r 238939762b61 https://code.google.com/p/go #

Patch Set 9 : diff -r 238939762b61 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -5 lines) Patch
M src/pkg/html/template/clone_test.go View 1 2 3 7 2 chunks +40 lines, -0 lines 0 comments Download
M src/pkg/html/template/template.go View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/text/template/parse/parse.go View 1 2 3 4 5 6 7 5 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/text/template/parse/parse_test.go View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 9
josharian
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 9 months ago (2013-08-04 15:22:47 UTC) #1
r
This CL changes the semantics of html/template's Clone method. See the comment at the top, ...
10 years, 9 months ago (2013-08-05 00:50:29 UTC) #2
josharian
On 2013/08/05 00:50:29, r wrote: > This CL changes the semantics of html/template's Clone method. ...
10 years, 9 months ago (2013-08-06 01:34:25 UTC) #3
josharian
Hello golang-dev@googlegroups.com, r@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
10 years, 7 months ago (2013-09-13 15:45:47 UTC) #4
josharian
On 2013/09/13 15:45:47, josharian wrote: > Hello mailto:golang-dev@googlegroups.com, mailto:r@golang.org (cc: > mailto:golang-dev@googlegroups.com), > > Please ...
10 years, 7 months ago (2013-09-13 15:47:59 UTC) #5
r
here's what i think: if you add this method to text/template/parse: // Copy returns a ...
10 years, 7 months ago (2013-09-17 03:44:26 UTC) #6
josharian
> here's what i think: > > if you add this method to text/template/parse: > ...
10 years, 7 months ago (2013-09-17 04:08:12 UTC) #7
r
LGTM
10 years, 7 months ago (2013-09-17 04:14:47 UTC) #8
r
10 years, 7 months ago (2013-09-17 04:19:53 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=285560f2ebe8 ***

text/template/parse, html/template: copy Tree.text during html template clone

The root cause of the panic reported in
https://code.google.com/p/go/issues/detail?id=5980
is that parse's Tree.Text wasn't being copied during the clone.

Fix this by adding and using a Copy method for parse.Tree.

Fixes issue 5980.

R=golang-dev, r
CC=golang-dev
https://codereview.appspot.com/12420044

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

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