0
0
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:
Kalle Olavi Niemitalo
2007-06-21 21:34:36 +03:00
committed by Kalle Olavi Niemitalo
parent 9f75e1f094
commit 58e3ebf2e7
2 changed files with 23 additions and 4 deletions

View File

@@ -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;