On Wed, Mar 04, 2015 at 10:47:15AM +0100, Julien Puydt wrote: > Hi, > > Le 04/03/2015 00:53, Bill Allombert a écrit : > > > >I expect they should do something like > >if (setjmp(&iferr_env)) > >{ > > GEN E = pari_err_last(); > > char *s = GSTR(GENtoGENstr(E)); > > fprintf(stderr,s); > > ... > >} > >before the point they are recovering using cb_pari_err_recover() at this > >time. > > I had a look at their code, and in fact, what they do is: > - detect there has been an error (cb_pari_err_handle is used here) ; > - if it's a normal error, raise a python exception ; > - if it's a stack overflow, double the stack ; > - in case of any error, apparently pari always tries to recover
Not recovering in PARI term means terminating the program. > (cb_pari_err_recover is used here) : if there is a python exception, > they decide it's a real error and don't recover -- if there isn't > (doubling the stack succeeded), they restart the computation. > > I see there is also a cb_pari_err_pre_recover... could it be used > instead of cb_pari_err_handle, given their use-case? No it will not work. What they should do is to move their recover code inside some if (setjmp(&iferr_env)) { } block that is put somewhere appropriate. Cheers, -- Bill. <ballo...@debian.org> Imagine a large red swirl here. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org