Skip to content

Commit 42abedb

Browse files
authored
fix: keep atomic counter aligned on 64 bits boundary
Fixes #845.
1 parent 151699e commit 42abedb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

interp/interp.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,15 @@ type Interpreter struct {
130130
// architectures.
131131
id uint64
132132

133+
// nindex is a node number incremented for each new node.
134+
// It is used for debug (AST and CFG graphs). As it is atomically
135+
// incremented, keep it aligned on 64 bits boundary.
136+
nindex int64
137+
133138
name string // name of the input source file (or main)
134139

135140
opt // user settable options
136141
cancelChan bool // enables cancellable chan operations
137-
nindex int64 // next node index
138142
fset *token.FileSet // fileset to locate node in source code
139143
binPkg Exports // binary packages used in interpreter, indexed by path
140144
rdir map[string]bool // for src import cycle detection

0 commit comments

Comments
 (0)