Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change
MolienSeries
to not hang on certain invalid inputs (#5919)
When a virtual character that is not an actual character was fed to MolienSeries, that could lead to an infinite loop. The reason in that case was that a quotient of two polynomials was computed that did not produce a polynomial, but rather a rational function. Calling `GcdRepresentation(F, f)` on that as a first step then tried to compute a ring containing both arguments, which ultimately caused the infinite loop. We fix this by passing a parent ring to `GcdRepresentation` which then raises an error in the above situation. The error message of course is not perfect, but note that other invalid inputs already can lead to different errors in other places in the code. Essentially the user is at fault here for passing in garbage. But we make this patch anyway because getting any error is certainly more helpful than an infinite loop.
- Loading branch information