Ticket #300 (closed bug: invalid)

Opened 13 years ago

Last modified 11 years ago

Bad .get_results in a exception handler gives infinite recursion

Reported by: NotFound Owned by:
Priority: normal Milestone:
Component: core Version:
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:


A bad .get_results in a exception handler generates a exception when used. That exception is catched by the same handler, that generates a exception that is catched by the same handler...

This example illustrates it:

.sub main :main
    push_eh catchall
    $P0 = new ['Exception' ]
    throw $P0
    .get_results($P1, $P2)

Change History

Changed 12 years ago by jkeenan

I probably don't understand the problem here, but tonight I put this PIR into a file and attempted to execute it.

$ cat bad.pir
# Copyright (C) 2006-2009, Parrot Foundation.
# $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $

.sub main :main
    push_eh catchall
    $P0 = new ['Exception' ]
    throw $P0
    .get_results($P1, $P2)

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

$ ./parrot bad.pir

I.e., no output; no evidence of error. Is there something wrong with that?


Changed 12 years ago by NotFound

Looks like now the extra results gets null assigned, but I don't know if this an intentional change or a bug.

Changed 11 years ago by whiteknight

  • status changed from new to closed
  • resolution set to invalid

The extra value is null-assigned after the PCC refactors and other subsequent changes. This is the correct behavior (certainly better than an infinite recursion loop). I'm closing this ticket. If we do not like the current behavior and want to change it to something else, we can open a second ticket for that.

Note: See TracTickets for help on using tickets.