It was only really necessary for ensuring that package runtime should
be treated as safe even without a "safe" marker, but mkbuiltin.go now
compiles it with -u.
Change-Id: Ifbcc62436ce40ab732ece667141afd82c1d3b64b
Reviewed-on: https://go-review.googlesource.com/19625
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
}
type Io struct {
- infile string
- bin *obj.Biobuf
- cp string // used for content when bin==nil
- last int
- peekc int
- peekc1 int // second peekc for ...
- nlsemi bool
- eofnl bool
- importsafe bool
+ infile string
+ bin *obj.Biobuf
+ cp string // used for content when bin==nil
+ last int
+ peekc int
+ peekc1 int // second peekc for ...
+ nlsemi bool
+ eofnl bool
}
type Dlist struct {
curio.infile = file
curio.cp = cp
curio.nlsemi = false
- curio.importsafe = false
typecheckok = true
incannedimport = 1
} else {
cannedimports("runtime.Builtin", runtimeimport)
}
- curio.importsafe = true
p.import_package()
p.import_there()
p.import_error()
}
+ importsafe := false
if p.tok == LNAME {
if p.sym_.Name == "safe" {
- curio.importsafe = true
+ importsafe = true
}
p.next()
}
if incannedimport == 0 {
importpkg.Direct = true
}
- importpkg.Safe = curio.importsafe
+ importpkg.Safe = importsafe
- if safemode != 0 && !curio.importsafe {
+ if safemode != 0 && !importsafe {
Yyerror("cannot import unsafe package %q", importpkg.Path)
}
}