mirror of
https://github.com/rkd77/elinks.git
synced 2025-09-21 19:46:23 -04:00
Bug 957: Assert that the ECMAScript interpreter is not running.
Add ecmascript_interpreter.backend_nesting, increment it when beginning to evaluate an expression, and decrement it when evaluation finishes. Then assert that it is zero in ecmascript_put_interpreter. This detects bug 957 and similar ones before they corrupt memory.
This commit is contained in:
committed by
Kalle Olavi Niemitalo
parent
9f75e1f094
commit
58e3ebf2e7
@@ -18,6 +18,12 @@ struct view_state;
|
||||
struct ecmascript_interpreter {
|
||||
struct view_state *vs;
|
||||
void *backend_data;
|
||||
|
||||
/* Nesting level of calls to backend functions. When this is
|
||||
* nonzero, there are references to backend_data in the C
|
||||
* stack, so it is not safe to free the data yet. */
|
||||
int backend_nesting;
|
||||
|
||||
/* Used by document.write() */
|
||||
struct string *ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user