Avoid random content in bvalue (#21846)

This commit is contained in:
s-hadinger 2024-07-25 23:11:14 +02:00 committed by GitHub
parent b8d7b5e2fa
commit f97c47c511
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? */
if (idx == -1) { /* if not add it */
bvalue k;
bvalue k = {};
switch (e->type) {
case ETINT:
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)
{
int src;
bvalue var;
bvalue var = {};
var_setclass(&var, c); /* new var of CLASS type */
src = newconst(finfo, &var); /* allocate a new constant and return kreg */
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)
{
bvalue k;
bvalue k = {};
k.type = BE_CLASS;
k.v.p = c;
int idx = newconst(finfo, &k); /* create new constant */