Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwind functions don't propagate from REDUCE #1760

Closed
rebolbot opened this issue Nov 11, 2010 · 3 comments
Closed

Unwind functions don't propagate from REDUCE #1760

rebolbot opened this issue Nov 11, 2010 · 3 comments

Comments

@rebolbot
Copy link
Collaborator

Submitted by: BrianH

The unwind functions: RETURN, EXIT, BREAK, CONTINUE, THROW.

The unwinding process doesn't propagate from unwind expressions within the REDUCE code block. If any of the results of those expressions are unwind values then they should be returned instead of the result block. This will allow them to propagate up the call chain.

As it is, the unwind values are just stored in the result block. This is a security hole, and breaks these functions.

This is related to #771, #1509 and #1519. Strangely enough, COMPOSE works properly.

>> reduce [break]
== [make error! 0]
>> compose [(break)]
** Throw error: no loop to break

CC - Data [ Version: alpha 110 Type: Bug Platform: All Category: Error Handling Reproduce: Always Fixed-in:r3 master ]

@rebolbot
Copy link
Collaborator Author

Submitted by: BrianH

Weird: I was expecting QUIT and HALT to be caught by this as well, but they aren't, and not by #1519 either.

@rebolbot
Copy link
Collaborator Author

Submitted by: abolka

Good catch. QUIT and HALT are not affected because they are throws, not unwinds (per the terminology of http://www.rebol.com/r3/notes/errors.html).

@rebolbot
Copy link
Collaborator Author

Submitted by: Ladislav

In the core-tests suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants