diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b3d1a9..fffbd4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ on: push: tags: - '*' + workflow_dispatch: + # Allow to run manually jobs: build: diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx index 247b1ad..d550374 100644 --- a/cypari2/gen.pyx +++ b/cypari2/gen.pyx @@ -1531,6 +1531,11 @@ cdef class Gen(Gen_base): self.cache((i,j), x) xt = x.ref_target() + + if not is_universal_constant(x.g): + # Make sure that self is on the heap, before we assign a clone to it. + self.fixGEN() + set_gcoeff(self.g, i+1, j+1, xt) return @@ -1555,6 +1560,10 @@ cdef class Gen(Gen_base): self.cache(i, x) xt = x.ref_target() + if not is_universal_constant(x.g): + # Make sure that self is on the heap, before we assign a clone to it. + self.fixGEN() + if typ(self.g) == t_LIST: listput(self.g, xt, i+1) else: diff --git a/cypari2/pari_instance.pyx b/cypari2/pari_instance.pyx index 4291188..9180392 100644 --- a/cypari2/pari_instance.pyx +++ b/cypari2/pari_instance.pyx @@ -1298,6 +1298,10 @@ cdef class Pari(Pari_auto): if len(entries) != m * n: raise IndexError("len of entries (=%s) must be %s*%s=%s"%(len(entries),m,n,m*n)) k = 0 + + # Make sure that A is on the heap, before we assign clones to it. + A.fixGEN() + for i in range(m): for j in range(n): sig_check() @@ -1318,7 +1322,7 @@ cdef class Pari(Pari_auto): If the second argument `p` is specified, it must be a prime. Then only the local information at `p` is computed and returned. - + Examples: >>> import cypari2