Follow declaration of variables before for loop

This commit is contained in:
satk0 2024-10-07 22:08:00 +02:00 committed by Saúl Ibarra Corretgé
parent 86b1853a21
commit ba863b1a82

View file

@ -6673,7 +6673,7 @@ static void build_backtrace(JSContext *ctx, JSValue error_obj,
}
done:
if (has_prepare) {
int j = 0;
int j = 0, k;
stack = JS_NewArray(ctx);
if (JS_IsException(stack)) {
stack = JS_NULL;
@ -6689,7 +6689,7 @@ static void build_backtrace(JSContext *ctx, JSValue error_obj,
}
}
// Clear the csd's we didn't use in case of error.
for (int k = j; k < i; k++) {
for (k = j; k < i; k++) {
JS_FreeValue(ctx, csd[k].filename);
JS_FreeValue(ctx, csd[k].func);
JS_FreeValue(ctx, csd[k].func_name);
@ -49847,7 +49847,9 @@ static struct {
};
static BOOL string_get_tzabbr(const uint8_t *sp, int *pp, int *offset) {
for (size_t i = 0; i < countof(js_tzabbr); i++) {
size_t i;
for (i = 0; i < countof(js_tzabbr); i++) {
if (string_match(sp, pp, js_tzabbr[i].name)) {
*offset = js_tzabbr[i].offset;
return TRUE;