From 0bf0a678c6f0f0c865f89a43da1b3f84922cfdc7 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 12:56:34 +0100 Subject: [PATCH 1/2] allow to run manually --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) 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: From fa1216cbaab56078003bfdac153c2f5cf183edc2 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Fri, 21 Jan 2022 12:01:50 +0100 Subject: [PATCH 2/2] do not assign clones to objects on the pari stack --- cypari2/gen.pyx | 9 +++++++++ cypari2/pari_instance.pyx | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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