Skip to content

Commit

Permalink
fix regression in bch.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jkent authored Aug 6, 2024
1 parent 42d8bbc commit 5a7a11c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bch.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ struct gf_poly {

/* polynomial of degree 1 */
struct gf_poly_deg1 {
struct gf_poly poly;
struct {
unsigned int deg;
} poly;
unsigned int c[2];
};

Expand Down Expand Up @@ -991,7 +993,7 @@ static void factor_polynomial(struct bch_control *bch, int k, struct gf_poly *f,
/* compute h=f/gcd(f,tk); this will modify f and q */
gf_poly_div(bch, f, gcd, q);
/* store g and h in-place (clobbering f) */
*h = &((struct gf_poly_deg1 *)f)[gcd->deg].poly;
*h = (struct gf_poly *) &((struct gf_poly_deg1 *)f)[gcd->deg].poly;
gf_poly_copy(*g, gcd);
gf_poly_copy(*h, q);
}
Expand Down

0 comments on commit 5a7a11c

Please sign in to comment.