зеркало из https://github.com/mozilla/pjs.git
(Not part of Communicator build.)
Fix 129824 monkey: evaling a function with many arguments fails
This commit is contained in:
Родитель
aefd097115
Коммит
a19e129aab
|
@ -1035,10 +1035,10 @@ fun_xdrObject(JSXDRState *xdr, JSObject **objp)
|
|||
}
|
||||
|
||||
if (!JS_XDRStringOrNull(xdr, &atomstr) ||
|
||||
!JS_XDRUint8(xdr, &fun->nargs) ||
|
||||
!JS_XDRUint8(xdr, &fun->flags) ||
|
||||
!JS_XDRUint16(xdr, &fun->nargs) ||
|
||||
!JS_XDRUint16(xdr, &fun->extra) ||
|
||||
!JS_XDRUint16(xdr, &fun->nvars))
|
||||
!JS_XDRUint16(xdr, &fun->nvars) ||
|
||||
!JS_XDRUint8(xdr, &fun->flags))
|
||||
return JS_FALSE;
|
||||
|
||||
/* do arguments and local vars */
|
||||
|
|
|
@ -30,11 +30,11 @@ struct JSFunction {
|
|||
jsrefcount nrefs; /* number of referencing objects */
|
||||
JSObject *object; /* back-pointer to GC'ed object header */
|
||||
JSNative call; /* native method pointer or null */
|
||||
uint8 nargs; /* minimum number of actual arguments */
|
||||
uint8 flags; /* bound method and other flags, see jsapi.h */
|
||||
uint16 nargs; /* minimum number of actual arguments */
|
||||
uint16 extra; /* number of arg slots for local GC roots */
|
||||
uint16 nvars; /* number of local variables */
|
||||
uint16 spare; /* reserved for future use */
|
||||
uint8 flags; /* bound method and other flags, see jsapi.h */
|
||||
uint8 spare; /* reserved for future use */
|
||||
JSAtom *atom; /* name for diagnostics and decompiling */
|
||||
JSScript *script; /* interpreted bytecode descriptor or null */
|
||||
};
|
||||
|
|
|
@ -2455,21 +2455,31 @@ out:
|
|||
|
||||
/* Routines to print out values during debugging. */
|
||||
|
||||
void printVal(jsval val) {
|
||||
jsuint i;
|
||||
JSString *str;
|
||||
void printJschar(jschar *cp) {
|
||||
fprintf(stderr, "jschar* (0x%x) \"", cp);
|
||||
while (*cp)
|
||||
fputc(*cp++, stderr);
|
||||
fputc('"', stderr);
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
void printString(JSString *str) {
|
||||
jsuint i;
|
||||
fprintf(stderr, "string (0x%x) \"", str);
|
||||
for (i=0; i < str->length; i++)
|
||||
fputc(str->chars[i], stderr);
|
||||
fputc('"', stderr);
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
void printVal(jsval val) {
|
||||
fprintf(stderr, "val %d (0x%x) = ", val, val);
|
||||
if (JSVAL_IS_INT(val)) {
|
||||
fprintf(stderr, "(int) %d\n", JSVAL_TO_INT(val));
|
||||
} else if (JSVAL_IS_STRING(val)) {
|
||||
fprintf(stderr, "(string) \"");
|
||||
str = JSVAL_TO_STRING(val);
|
||||
for (i=0; i < str->length; i++)
|
||||
fputc(str->chars[i], stderr);
|
||||
fputc('"', stderr);
|
||||
fputc('\n', stderr);
|
||||
printString(JSVAL_TO_STRING(val));
|
||||
}
|
||||
/* XXX more cases */
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
@ -2478,5 +2488,9 @@ void printId(jsid id) {
|
|||
printVal(js_IdToValue(id));
|
||||
}
|
||||
|
||||
void printAtom(JSAtom *atom) {
|
||||
printString(ATOM_TO_STRING(atom));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче