forked from svaarala/duktape
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-currpc-setjmp-sync'
Fix a thr->ptr_curr_pc reference in the error unwind path which could lead to a dereference of thr->ptr_curr_pc when it pointed to an already unwound C stack frame.
- Loading branch information
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Memory unsafety issue when developing GH-294. | ||
*/ | ||
|
||
/*=== | ||
f | ||
g | ||
Error: myerror | ||
===*/ | ||
|
||
function f() { | ||
print('f'); | ||
function g() { | ||
print('g'); | ||
throw new Error('myerror'); | ||
} | ||
g(); | ||
} | ||
|
||
try { | ||
// Calling as f() does not trigger the error, but calling through | ||
// apply() does. The internal difference is that apply() goes through | ||
// duk_handle_call(). | ||
f.apply(); | ||
} catch (e) { | ||
print(e); | ||
} |