bug - interaction between unwind-protect, function call, multiple values

6 messages Options
Embed this post
Permalink
Alan Ruttenberg-2

bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
(defun bar () (values 1 2))
(bar) =>
1
2
(defun foo () (unwind-protect (return-from foo (bar)) 2))
(foo) =>
1
(defun foo () (unwind-protect (return-from foo (values 1 2) 2)))
(foo) =>
1
2

I noticed this in an early version of abcl, but just downloaded and
built from subversion and it's still there.
Doesn't seem to matter whether it is interpreted or evaluated.

-Alan

------------------------------------------------------------------------------
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Kevin Reid

Re: bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
On Jul 26, 2009, at 20:08, Alan Ruttenberg wrote:

> (defun foo () (unwind-protect (return-from foo (values 1 2) 2)))


Not necessarily relevant, but this RETURN-FROM form is incorrect;  
RETURN-FROM has at most two parameters.

--
Kevin Reid                                  <http://switchb.org/kpreid/>





------------------------------------------------------------------------------
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Erik Huelsmann

Re: bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alan Ruttenberg-2
Hi Alan!

On Mon, Jul 27, 2009 at 2:08 AM, Alan
Ruttenberg<[hidden email]> wrote:

> (defun bar () (values 1 2))
> (bar) =>
> 1
> 2
> (defun foo () (unwind-protect (return-from foo (bar)) 2))
> (foo) =>
> 1
> (defun foo () (unwind-protect (return-from foo (values 1 2) 2)))
> (foo) =>
> 1
> 2
>
> I noticed this in an early version of abcl, but just downloaded and
> built from subversion and it's still there.
> Doesn't seem to matter whether it is interpreted or evaluated.

I can see the error in the compiler; it's in p2-unwind-proctect: the
exception handler doesn't save the values register of the thread.
Maybe it's the same in the interpreter. I'll have a look later today,
if I have time.


Thanks for the report!


Bye,

Erik.

------------------------------------------------------------------------------
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alan Ruttenberg-2

Re: bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
In reply to this post by Kevin Reid
Good point. Misplaced parenthesis - meant the second 2 to be the cleanup form.
-Alan

On Sun, Jul 26, 2009 at 10:54 PM, Kevin Reid<[hidden email]> wrote:

> On Jul 26, 2009, at 20:08, Alan Ruttenberg wrote:
>
>> (defun foo () (unwind-protect (return-from foo (values 1 2) 2)))
>
>
> Not necessarily relevant, but this RETURN-FROM form is incorrect;
> RETURN-FROM has at most two parameters.
>
> --
> Kevin Reid                                  <http://switchb.org/kpreid/>
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> armedbear-j-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
>

------------------------------------------------------------------------------
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Erik Huelsmann

Re: bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
In reply to this post by Alan Ruttenberg-2
Hi Alan,

On Mon, Jul 27, 2009 at 2:08 AM, Alan
Ruttenberg<[hidden email]> wrote:

> (defun bar () (values 1 2))
> (bar) =>
> 1
> 2
> (defun foo () (unwind-protect (return-from foo (bar)) 2))
> (foo) =>
> 1
> (defun foo () (unwind-protect (return-from foo (values 1 2) 2)))
> (foo) =>
> 1
> 2
>
> I noticed this in an early version of abcl, but just downloaded and
> built from subversion and it's still there.
> Doesn't seem to matter whether it is interpreted or evaluated.

It didn't matter whether interpreter or compiled, because both had the
same issue.

Anyway, thanks for the report! It's fixed now.

Bye,

Erik.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alan Ruttenberg-2

Re: bug - interaction between unwind-protect, function call, multiple values

Reply Threaded More More options
Print post
Permalink
On Tue, Jul 28, 2009 at 2:24 AM, Erik Huelsmann<[hidden email]> wrote:

> Hi Alan,
>
> On Mon, Jul 27, 2009 at 2:08 AM, Alan
> Ruttenberg<[hidden email]> wrote:
>> (defun bar () (values 1 2))
>> (bar) =>
>> 1
>> 2
>> (defun foo () (unwind-protect (return-from foo (bar)) 2))
>> (foo) =>
>> 1
>> (defun foo () (unwind-protect (return-from foo (values 1 2) 2)))
>> (foo) =>
>> 1
>> 2
>>
>> I noticed this in an early version of abcl, but just downloaded and
>> built from subversion and it's still there.
>> Doesn't seem to matter whether it is interpreted or evaluated.
>
> It didn't matter whether interpreter or compiled, because both had the
> same issue.
>
> Anyway, thanks for the report! It's fixed now.

Excellent :)
Thanks for the quick response!
-Alan
>
> Bye,
>
> Erik.
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel