From 2f355b464e25662beac7f985c2acb9ee0f924c33 Mon Sep 17 00:00:00 2001 From: Bob Burger Date: Fri, 15 Jun 2018 16:42:09 -0400 Subject: [PATCH] Avoid an occasional invalid memory violation on Windows in S_call_help original commit: c2d2467d48eea145455124343c8819dfb683c39e --- LOG | 2 ++ c/schlib.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/LOG b/LOG index 69b8f124ae..68ae20332c 100644 --- a/LOG +++ b/LOG @@ -956,3 +956,5 @@ - Repair x86_64 `&` foreign-procedure result type handling for types of a small size that is not a multiple of the word size x86_64.ss, foreign.ms, foreign4.c +- Avoid an occasional invalid memory violation on Windows in S_call_help + schlib.c diff --git a/c/schlib.c b/c/schlib.c index 23ea47dcbf..4f3c2e300d 100644 --- a/c/schlib.c +++ b/c/schlib.c @@ -206,9 +206,11 @@ static ptr S_call(tc, cp, argcnt) ptr tc; ptr cp; iptr argcnt; { } /* args are set up, argcnt in ac0, closure in ac1 */ -void S_call_help(tc, singlep, lock_ts) ptr tc; IBOOL singlep; IBOOL lock_ts; { - /* declaring code volatile should be unnecessary, but it quiets gcc */ +void S_call_help(tc_in, singlep, lock_ts) ptr tc_in; IBOOL singlep; IBOOL lock_ts; { + /* declaring code and tc volatile should be unnecessary, but it quiets gcc + and avoids occasional invalid memory violations on Windows */ void *jb; volatile ptr code; + volatile ptr tc = tc_in; /* lock caller's code object, since his return address is sitting in the C stack and we may end up in a garbage collection */