Skip to content

Commit

Permalink
Fix 'lock overflow' when calling methods with 'this' bound (fix #870, f…
Browse files Browse the repository at this point in the history
…ix #885)
  • Loading branch information
gfwilliams committed Jul 25, 2016
1 parent 62308a2 commit 4fba95e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
@@ -1,6 +1,7 @@
1v87 : Add support for compiling with float-abi=hard (even if it doesn't give us real-world benefits)
Add shortcut for quick execution of common call types
Fix BBC micro:bit save() regression from 1v86
Fix 'lock overflow' when calling methods with 'this' bound (fix #870, fix #885)

1v86 : Compile Telnet server into linux by default, Add '--telnet' command-line option to enable it
Fix lock 'leak' in Telnet when Telnet is turned off
Expand Down
6 changes: 4 additions & 2 deletions src/jsparse.c
Expand Up @@ -684,8 +684,10 @@ NO_INLINE JsVar *jspeFunctionCall(JsVar *function, JsVar *functionName, JsVar *t
if (jsvIsStringEqual(param, JSPARSE_FUNCTION_SCOPE_NAME)) functionScope = jsvSkipName(param);
else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_CODE_NAME)) functionCode = jsvSkipName(param);
else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_NAME_NAME)) functionInternalName = jsvSkipName(param);
else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_THIS_NAME)) thisVar = jsvSkipName(param);
else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_LINENUMBER_NAME)) functionLineNumber = (uint16_t)jsvGetIntegerAndUnLock(jsvSkipName(param));
else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_THIS_NAME)) {
jsvUnLock(thisVar);
thisVar = jsvSkipName(param);
} else if (jsvIsStringEqual(param, JSPARSE_FUNCTION_LINENUMBER_NAME)) functionLineNumber = (uint16_t)jsvGetIntegerAndUnLock(jsvSkipName(param));
else if (jsvIsFunctionParameter(param)) {
JsVar *paramName = jsvCopy(param);
// paramName is already a name (it's a function parameter)
Expand Down

0 comments on commit 4fba95e

Please sign in to comment.