From df7f2a01bfa694fb4fdfc05de0744ac68a81d017 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 13 Oct 2014 21:16:23 +0100 Subject: [PATCH] fix a code-walking-related nondeterminism the assemble macro walks its body to collect labels, and carefully manages the set of labels with set operations. Sensible! I hear you cry: except that the sets of label names are then bound to label objects in order, which if the set representations do not themselves share an order leads to differences in machine code. Fix this by sorting appropriate lists, making sure to generate fresh list structure where potentially necessary. --- src/compiler/assem.lisp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compiler/assem.lisp b/src/compiler/assem.lisp index 03d7c6a9b..877591c89 100644 --- a/src/compiler/assem.lisp +++ b/src/compiler/assem.lisp @@ -1216,12 +1216,16 @@ (inherited-labels (multiple-value-bind (expansion expanded) (,macroexpand '..inherited-labels.. env) - (if expanded expansion nil))) - (new-labels (append labels - (set-difference visible-labels - inherited-labels))) - (nested-labels (set-difference (append inherited-labels new-labels) - visible-labels))) + (if expanded (copy-list expansion) nil))) + (new-labels + (sort (append labels + (set-difference visible-labels + inherited-labels)) + #'string<)) + (nested-labels + (sort (set-difference (append inherited-labels new-labels) + visible-labels) + #'string<))) (when (intersection labels inherited-labels) (error "duplicate nested labels: ~S" (intersection labels inherited-labels))) -- 2.11.4.GIT