protect entry to critical section

This commit is contained in:
Vítor Santos Costa 2016-01-31 10:13:51 +00:00
parent ddabfe45b8
commit d90a0f72b0

View File

@ -1954,8 +1954,9 @@ static Int p_compile(USES_REGS1) { /* '$compile'(+C,+Flags,+C0,-Ref) */
cclause() in case there is a overflow */ cclause() in case there is a overflow */
t = Deref(ARG1); /* just in case there was an heap overflow */ t = Deref(ARG1); /* just in case there was an heap overflow */
if (!LOCAL_ErrorMessage) { if (!LOCAL_ErrorMessage) {
YAPEnterCriticalSection();
addclause(t, code_adr, mode, mod, &ARG5); addclause(t, code_adr, mode, mod, &ARG5);
YAPLeaveCriticalSection();
} }
if (LOCAL_ErrorMessage) { if (LOCAL_ErrorMessage) {
if (!LOCAL_Error_Term) if (!LOCAL_Error_Term)
@ -1964,7 +1965,6 @@ static Int p_compile(USES_REGS1) { /* '$compile'(+C,+Flags,+C0,-Ref) */
YAPLeaveCriticalSection(); YAPLeaveCriticalSection();
return false; return false;
} }
YAPLeaveCriticalSection();
return true; return true;
} }