summaryrefslogtreecommitdiff
path: root/src/cmd/asm/internal/lex/tokenizer.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/asm/internal/lex/tokenizer.go')
-rw-r--r--src/cmd/asm/internal/lex/tokenizer.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/asm/internal/lex/tokenizer.go b/src/cmd/asm/internal/lex/tokenizer.go
index 6a6fdbc776..24a72479db 100644
--- a/src/cmd/asm/internal/lex/tokenizer.go
+++ b/src/cmd/asm/internal/lex/tokenizer.go
@@ -39,7 +39,9 @@ func NewTokenizer(name string, r io.Reader, file *os.File) *Tokenizer {
scanner.ScanComments
s.Position.Filename = name
s.IsIdentRune = isIdentRune
- obj.Linklinehist(linkCtxt, histLine, name, 0)
+ if file != nil {
+ obj.Linklinehist(linkCtxt, histLine, name, 0)
+ }
return &Tokenizer{
s: &s,
line: 1,
@@ -107,7 +109,9 @@ func (t *Tokenizer) Next() ScanToken {
}
switch t.tok {
case '\n':
- histLine++
+ if t.file != nil {
+ histLine++
+ }
t.line++
case '-':
if s.Peek() == '>' {