From 2f25a1e2bd903a80944e3eb0119dbee8b5f7669f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 30 Oct 2015 21:31:57 -0400 Subject: [PATCH] fix GC-related issue with recent cache repair Repairs a problem with d719c06e00. A GC can happen while checking whether a cache entry matches, in which case the cache is cleared, so don't check the cache slot again after comparing. Merge to v6.3 --- racket/src/racket/src/syntax.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/racket/src/racket/src/syntax.c b/racket/src/racket/src/syntax.c index f87cd2f529..8c3c630c86 100644 --- a/racket/src/racket/src/syntax.c +++ b/racket/src/racket/src/syntax.c @@ -1808,17 +1808,19 @@ static void intern_scope_set(Scheme_Scope_Table *t, int prop_table) enough. */ { int i; + Scheme_Scope_Set *s; if (!t->simple_scopes || !scope_set_count(t->simple_scopes)) return; for (i = 0; i < NUM_RECENT_SCOPE_SETS; i++) { - if (recent_scope_sets[prop_table][i]) { - if (recent_scope_sets[prop_table][i] == t->simple_scopes) + s = recent_scope_sets[prop_table][i]; + if (s) { + if (s == t->simple_scopes) return; - if (scopes_equal(recent_scope_sets[prop_table][i], t->simple_scopes) - && (!prop_table || scope_props_equal(recent_scope_sets[prop_table][i], t->simple_scopes))) { - t->simple_scopes = recent_scope_sets[prop_table][i]; + if (scopes_equal(s, t->simple_scopes) + && (!prop_table || scope_props_equal(s, t->simple_scopes))) { + t->simple_scopes = s; return; } }