]> Cypherpunks repositories - gostls13.git/commit
text/template/parse: fix data race
authorRob Pike <r@golang.org>
Mon, 30 Jul 2012 22:11:20 +0000 (15:11 -0700)
committerRob Pike <r@golang.org>
Mon, 30 Jul 2012 22:11:20 +0000 (15:11 -0700)
commit20d9fd3ae18bd5f80c3c0f8f424ebd9a72b6788a
tree9511bb803e20c2bfd0968f0ad7b4df9213fb25c2
parent4783ad82dac77de7bcb49d6addefdf758412bfe5
text/template/parse: fix data race
The situation only affects diagnostics but is easy to fix.
When computing lineNumber, use the position of the last item
returned by nextItem rather than the current state of the lexer.
This is internal only and does not affect the API.

Fixes #3886.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6445061
src/pkg/text/template/parse/lex.go
src/pkg/text/template/parse/lex_test.go