зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1196391, part 1 - Make the type of locals in js::ExpandErrorArgumentsVA() match the type of JSErrorFormatString::argCount. r=Waldo
This commit is contained in:
Родитель
4955cf8ac2
Коммит
7f296622e0
|
@ -565,8 +565,7 @@ js::ExpandErrorArgumentsVA(ExclusiveContext* cx, JSErrorCallback callback,
|
|||
ErrorArgumentsType argumentsType, va_list ap)
|
||||
{
|
||||
const JSErrorFormatString* efs;
|
||||
int i;
|
||||
int argCount;
|
||||
uint16_t argCount;
|
||||
bool messageArgsPassed = !!reportp->messageArgs;
|
||||
|
||||
*messagep = nullptr;
|
||||
|
@ -602,7 +601,7 @@ js::ExpandErrorArgumentsVA(ExclusiveContext* cx, JSErrorCallback callback,
|
|||
/* nullptr-terminate for easy copying. */
|
||||
reportp->messageArgs[argCount] = nullptr;
|
||||
}
|
||||
for (i = 0; i < argCount; i++) {
|
||||
for (uint16_t i = 0; i < argCount; i++) {
|
||||
if (messageArgsPassed) {
|
||||
/* Do nothing. */
|
||||
} else if (argumentsType == ArgumentsAreASCII) {
|
||||
|
@ -708,7 +707,7 @@ error:
|
|||
if (!messageArgsPassed && reportp->messageArgs) {
|
||||
/* free the arguments only if we allocated them */
|
||||
if (argumentsType == ArgumentsAreASCII) {
|
||||
i = 0;
|
||||
uint16_t i = 0;
|
||||
while (reportp->messageArgs[i])
|
||||
js_free((void*)reportp->messageArgs[i++]);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче