Skip to content

Commit

Permalink
Fix lock double-release.
Browse files Browse the repository at this point in the history
The exclusive lock for from-JavaScript closure invocation was released
twice when an exception was raised during evaluation.
  • Loading branch information
m4burns committed Feb 25, 2014
1 parent 04ce8e3 commit 1625670
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions whalesong/js-assembler/runtime-src/baselib-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 1625670

Please sign in to comment.