]> www.ginac.de Git - ginac.git/blobdiff - ginac/factor.cpp
[BUGFIX] Fix crash in parser.
[ginac.git] / ginac / factor.cpp
index a07a42b099884911086f348847ad8626ef12af38..efe438eae8c59e658cd7553d2867aa42c71556b3 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 /*
- *  GiNaC Copyright (C) 1999-2023 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2024 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -2380,8 +2380,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
                copy_if(syms.begin(), syms.end(),
                        inserter(syms_wox, syms_wox.end()), [x](const ex& y){ return y != x; });
 
-               factorization_ctx ctx = {.poly = poly, .x = x,
-                                        .syms_wox = syms_wox};
+               factorization_ctx ctx{poly, x, syms_wox};
 
                // make polynomial primitive
                poly.unitcontprim(x, ctx.unit, ctx.cont, ctx.pp);
@@ -2394,7 +2393,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
                ctx.vn = ctx.pp.collect(x).lcoeff(x);
                ctx.vnlst = put_factors_into_vec(factor(ctx.vn));
 
-               ctx.modulus = (ctx.vnlst.size() > 3) ? ctx.vnlst.size() : 3;
+               ctx.modulus = (ctx.vnlst.size() > 3) ? ctx.vnlst.size() : numeric(3);
 
                ctx_in_x.push_back(ctx);
        }