]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/compile/internal/gc/noder.go
all: merge dev.typealias into master
[gostls13.git] / src / cmd / compile / internal / gc / noder.go
index 1d69151cc41dd2be51a70c01b9cf37820353774f..9dbe769fa7c8e370982501c0be6fd10778c1a840 100644 (file)
@@ -34,6 +34,7 @@ func parseFile(filename string) {
        }
 
        if nsyntaxerrors == 0 {
+               // Always run testdclstack here, even when debug_dclstack is not set, as a sanity measure.
                testdclstack()
        }
 }
@@ -1051,6 +1052,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma {
                lookup(f[1]).Linkname = f[2]
 
        case strings.HasPrefix(text, "go:cgo_"):
+               lineno = p.baseline + int32(line) - 1 // pragcgo may call yyerror
                pragcgobuf += pragcgo(text)
                fallthrough // because of //go:cgo_unsafe_args
        default:
@@ -1058,6 +1060,7 @@ func (p *noder) pragma(pos, line int, text string) syntax.Pragma {
                if i := strings.Index(text, " "); i >= 0 {
                        verb = verb[:i]
                }
+               lineno = p.baseline + int32(line) - 1 // pragmaValue may call yyerror
                return syntax.Pragma(pragmaValue(verb))
        }