REBOL3 tracker
  0.9.12 beta
Ticket #0001760 User: anonymous

Project:



rss
TypeBug Statusbuilt Date11-Nov-2010 16:17
Versionalpha 110 CategoryError Handling Submitted byBrianH
PlatformAll Severityminor Priorityhigh

Summary Unwind functions don't propagate from REDUCE
Description 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.
Example code
>> reduce [break]
== [make error! 0]
>> compose [(break)]
** Throw error: no loop to break

Assigned ton/a Fixed inr3 master Last Update19-Feb-2014 20:05


Comments
(0002834)
BrianH
11-Nov-2010 16:18

Weird: I was expecting QUIT and HALT to be caught by this as well, but they aren't, and not by #1519 either.
(0002838)
abolka
11-Nov-2010 23:47

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).
(0002878)
Ladislav
15-Nov-2010 19:43

In the core-tests suite.

Date User Field Action Change
19-Feb-2014 20:05 BrianH Fixedin Modified => r3 master
19-Feb-2014 20:05 BrianH Status Modified reviewed => built
15-Nov-2010 19:43 Ladislav Comment : 0002878 Added -
12-Nov-2010 05:13 carl Description Modified -
12-Nov-2010 05:13 carl Code Modified -
12-Nov-2010 05:13 carl Status Modified submitted => reviewed
11-Nov-2010 23:47 abolka Comment : 0002838 Modified -
11-Nov-2010 23:47 abolka Comment : 0002838 Added -
11-Nov-2010 16:18 BrianH Comment : 0002834 Added -
11-Nov-2010 16:17 BrianH Ticket Added -