Berry fix compilation error with some compiler options (#22200)

This commit is contained in:
s-hadinger 2024-09-24 22:58:49 +02:00 committed by GitHub
parent e3c47851b7
commit a306d77a5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -307,7 +307,7 @@ static int exp2const(bfuncinfo *finfo, bexpdesc *e)
{ {
int idx = findconst(finfo, e); /* does the constant already exist? */ int idx = findconst(finfo, e); /* does the constant already exist? */
if (idx == -1) { /* if not add it */ if (idx == -1) { /* if not add it */
bvalue k = {}; bvalue k = {0};
switch (e->type) { switch (e->type) {
case ETINT: case ETINT:
k.type = BE_INT; k.type = BE_INT;
@ -882,7 +882,7 @@ void be_code_index(bfuncinfo *finfo, bexpdesc *c, bexpdesc *k)
void be_code_class(bfuncinfo *finfo, bexpdesc *dst, bclass *c) void be_code_class(bfuncinfo *finfo, bexpdesc *dst, bclass *c)
{ {
int src; int src;
bvalue var = {}; bvalue var = {0};
var_setclass(&var, c); /* new var of CLASS type */ var_setclass(&var, c); /* new var of CLASS type */
src = newconst(finfo, &var); /* allocate a new constant and return kreg */ src = newconst(finfo, &var); /* allocate a new constant and return kreg */
if (dst->type == ETLOCAL) { /* if target is a local variable, just assign */ if (dst->type == ETLOCAL) { /* if target is a local variable, just assign */
@ -965,7 +965,7 @@ void be_code_raise(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2)
void be_code_implicit_class(bfuncinfo *finfo, bexpdesc *e, bclass *c) void be_code_implicit_class(bfuncinfo *finfo, bexpdesc *e, bclass *c)
{ {
bvalue k = {}; bvalue k = {0};
k.type = BE_CLASS; k.type = BE_CLASS;
k.v.p = c; k.v.p = c;
int idx = newconst(finfo, &k); /* create new constant */ int idx = newconst(finfo, &k); /* create new constant */