From 162567017312e97a7beeda976ddbba60d44b5389 Mon Sep 17 00:00:00 2001 From: Marc Burns Date: Tue, 25 Feb 2014 16:45:02 -0500 Subject: [PATCH] Fix lock double-release. The exclusive lock for from-JavaScript closure invocation was released twice when an exception was raised during evaluation. --- whalesong/js-assembler/runtime-src/baselib-functions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/whalesong/js-assembler/runtime-src/baselib-functions.js b/whalesong/js-assembler/runtime-src/baselib-functions.js index d2e0045..1d2741e 100644 --- a/whalesong/js-assembler/runtime-src/baselib-functions.js +++ b/whalesong/js-assembler/runtime-src/baselib-functions.js @@ -101,8 +101,7 @@ (succ || function () {}).apply(null, arguments); }; var wrappedFail = function(err) { - releaseLock(); - (fail || function () {})(err); + (fail || function () {})(err); }; if (!(baselib.arity.isArityMatching(v.racketArity, args.length - 2))) { var msg = baselib.format.format( @@ -159,8 +158,9 @@ MACHINE.v = oldVal; MACHINE.a = oldArgcount; MACHINE.p = oldProc; + // The lock is released by _trampoline in this case. wrappedFail(e); - }; + }; MACHINE._trampoline(v.label, false, releaseLock); });