Bug 470000 - JS_GET_SCRIPT_ATOM needs to use cx->fp safely, r=brendan

This commit is contained in:
Benjamin Smedberg 2008-12-22 11:07:40 -05:00
parent 5d05cfd543
commit 6f98baeeca

View File

@ -158,7 +158,8 @@ StackDepth(JSScript *script)
#define JS_GET_SCRIPT_ATOM(script_, index, atom) \
JS_BEGIN_MACRO \
if (cx->fp && cx->fp->imacpc && cx->fp->script == script_) { \
JSStackFrame *fp_ = js_GetTopStackFrame(cx); \
if (fp_ && fp_->imacpc && fp_->script == script_) { \
JS_ASSERT((size_t)(index) < js_common_atom_count); \
(atom) = COMMON_ATOMS_START(&cx->runtime->atomState)[index]; \
} else { \