From 976433d667e2502c25f8f6ac8eef04b7d472df6d Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 25 Apr 2021 20:27:34 +0200 Subject: [PATCH] Fix cached-module-box cache keys * module/language/cps/reify-primitives.scm (cached-module-box): Include public? in cache key, so we don't accidentally alias private and exported names. Also include bound?, to avoid a window in which thread A resolves and caches var V in preparation for setting it, but thread B sees V for ref before it was initialized. --- module/language/cps/reify-primitives.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/language/cps/reify-primitives.scm b/module/language/cps/reify-primitives.scm index 494f1ca56..710ad6ff0 100644 --- a/module/language/cps/reify-primitives.scm +++ b/module/language/cps/reify-primitives.scm @@ -1,6 +1,6 @@ ;;; Continuation-passing style (CPS) intermediate language (IL) -;; Copyright (C) 2013-2020 Free Software Foundation, Inc. +;; Copyright (C) 2013-2021 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -224,7 +224,7 @@ (define-ephemeral (cached-module-box cps k src param) (match param ((module name public? bound?) - (let ((cache-key (cons module name))) + (let ((cache-key param)) (with-cps cps (letv mod cached) (let$ lookup