mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
Don't try to access the name of arguments beyond nargs (r=brendan).
This commit is contained in:
parent
16a51ac34e
commit
44a2f2366a
@ -942,7 +942,7 @@ FlushNativeStackFrame(JSContext* cx, unsigned callDepth, uint8* mp, double* np)
|
||||
/* Emit load instructions onto the trace that read the initial stack state. */
|
||||
void
|
||||
TraceRecorder::import(LIns* base, ptrdiff_t offset, jsval* p, uint8& t,
|
||||
const char *prefix, int index, JSStackFrame *fp)
|
||||
const char *prefix, uintN index, JSStackFrame *fp)
|
||||
{
|
||||
LIns* ins;
|
||||
if (t == JSVAL_INT) { /* demoted */
|
||||
@ -972,8 +972,8 @@ TraceRecorder::import(LIns* base, ptrdiff_t offset, jsval* p, uint8& t,
|
||||
funName = fp->fun->atom ? js_AtomToPrintableString(cx, fp->fun->atom) : "<anonymous>";
|
||||
}
|
||||
if (!strcmp(prefix, "argv")) {
|
||||
JSAtom *atom = JS_LOCAL_NAME_TO_ATOM(localNames[index]);
|
||||
if (atom) {
|
||||
if (index < fp->fun->nargs) {
|
||||
JSAtom *atom = JS_LOCAL_NAME_TO_ATOM(localNames[index]);
|
||||
JS_snprintf(name, sizeof name, "$%s.%s", funName, js_AtomToPrintableString(cx, atom));
|
||||
} else {
|
||||
JS_snprintf(name, sizeof name, "$%s.<arg%d>", funName, index);
|
||||
|
@ -213,7 +213,7 @@ class TraceRecorder {
|
||||
ptrdiff_t nativeStackOffset(jsval* p) const;
|
||||
ptrdiff_t nativeGlobalOffset(jsval* p) const;
|
||||
void import(nanojit::LIns* base, ptrdiff_t offset, jsval* p, uint8& t,
|
||||
const char *prefix, int index, JSStackFrame *fp);
|
||||
const char *prefix, uintN index, JSStackFrame *fp);
|
||||
void import(unsigned ngslots, uint8* globalTypeMap, uint8* stackTypeMap);
|
||||
void trackNativeStackUse(unsigned slots);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user