From 42abedb25dae9ad58bca1c6acfa1edd0f999a70b Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Mon, 14 Sep 2020 15:32:03 +0200 Subject: [PATCH] fix: keep atomic counter aligned on 64 bits boundary Fixes #845. --- interp/interp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interp/interp.go b/interp/interp.go index 4c26e2b0b..9ad3341d2 100644 --- a/interp/interp.go +++ b/interp/interp.go @@ -130,11 +130,15 @@ type Interpreter struct { // architectures. id uint64 + // nindex is a node number incremented for each new node. + // It is used for debug (AST and CFG graphs). As it is atomically + // incremented, keep it aligned on 64 bits boundary. + nindex int64 + name string // name of the input source file (or main) opt // user settable options cancelChan bool // enables cancellable chan operations - nindex int64 // next node index fset *token.FileSet // fileset to locate node in source code binPkg Exports // binary packages used in interpreter, indexed by path rdir map[string]bool // for src import cycle detection