Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/template: zero template.Template no longer safe for use #11379

Closed
rsc opened this issue Jun 24, 2015 · 3 comments
Closed

text/template: zero template.Template no longer safe for use #11379

rsc opened this issue Jun 24, 2015 · 3 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jun 24, 2015

This program worked in Go 1.4 but crashes in Go 1.5.

package main

import "text/template"

func main() {
    template.Must(new(template.Template).New("main").Parse(""))
}

It dies in Parse because the overall group was created with new(template.Template) and has a nil *common pointer. Because this worked in Go 1.4, I think we should keep it working in Go 1.5. That might mean filling in common lazily.

@rsc rsc added this to the Go1.5 milestone Jun 24, 2015
@rsc
Copy link
Contributor Author

rsc commented Jun 24, 2015

Actually, I'll take this one since it's the middle of the night for Rob.

@rsc rsc assigned rsc and unassigned robpike Jun 24, 2015
@gopherbot
Copy link

CL https://golang.org/cl/11421 mentions this issue.

@mwhudson
Copy link
Contributor

I think this is a dup of #11226 but as this has discussion I'll close that one

@rsc rsc closed this as completed in 33ce9c1 Jun 24, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants