diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-20 05:13:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:46 -0500 |
commit | 6f48b3a5cbe0235e60834f0b96a34290797d3bf4 (patch) | |
tree | f4bc4e44e3f312bd15f2a0450ab582c551cc8498 /source4/lib/appweb/ejs/ejsLex.c | |
parent | e9c925f8727a8fa01935129ba8209183d111bd86 (diff) | |
download | samba-6f48b3a5cbe0235e60834f0b96a34290797d3bf4.tar.gz samba-6f48b3a5cbe0235e60834f0b96a34290797d3bf4.tar.bz2 samba-6f48b3a5cbe0235e60834f0b96a34290797d3bf4.zip |
r8630: give a much nicer backtrace on assert() failures in ejs
I will submit this upstream
(This used to be commit a2266f6927d953459bd4b02fbca0a9c95c18494e)
Diffstat (limited to 'source4/lib/appweb/ejs/ejsLex.c')
-rw-r--r-- | source4/lib/appweb/ejs/ejsLex.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/appweb/ejs/ejsLex.c b/source4/lib/appweb/ejs/ejsLex.c index a5f15c2979..b4617a638e 100644 --- a/source4/lib/appweb/ejs/ejsLex.c +++ b/source4/lib/appweb/ejs/ejsLex.c @@ -60,11 +60,13 @@ int ejsLexOpenScript(Ejs *ep, char *script) mprAssert(ep); mprAssert(script); - if ((ep->input = mprMalloc(sizeof(EjsInput))) == NULL) { + if ((ip = mprMalloc(sizeof(EjsInput))) == NULL) { return -1; } - ip = ep->input; memset(ip, 0, sizeof(*ip)); + ip->next = ep->input; + ep->input = ip; + ip->procName = ep->proc?ep->proc->procName:NULL; /* * Create the parse token buffer and script buffer @@ -102,6 +104,7 @@ void ejsLexCloseScript(Ejs *ep) ip = ep->input; mprAssert(ip); + ep->input = ip->next; for (i = 0; i < EJS_TOKEN_STACK; i++) { mprFree(ip->putBack[i].token); |