#154: subclassed ExceptionHandlers can't handle exceptions
--------------------+-------------------------------------------------------
 Reporter:  cotto   |       Owner:  whiteknight                          
     Type:  bug     |      Status:  assigned                             
 Priority:  major   |   Milestone:                                       
Component:  core    |     Version:  trunk                                
 Severity:  medium  |    Keywords:  exception, subclass, exceptionhandler
     Lang:          |       Patch:                                       
 Platform:  all     |  
--------------------+-------------------------------------------------------

Comment(by whiteknight):

 Okay, I think I have this issue figured out. Our subclassed type inherits
 from ExceptionHandler, which in turn inherits from Continuation PMC.
 Continuation has a Parrot_Context ATTR which cannot be inherited by a PIR
 subclass. Only INTVAL, FLOATVAL, PMC* and STRING* I think can be
 inherited. When we try to use the subclassed handler, we call

 {{{if (PMC_cont(handler)->current_results)}}}

 The normal GET_ATTR_* macros would throw an exception here that we tried
 to access an ATTR from a subclass that could not get accessed from a PIR
 subclass. However, the {{{PMC_cont}}} macro does not throw such an
 exception (that would have helped us identify the problem much earlier).
 When we go to pass the results, somebody is using the {{{PMC_cont}} macro
 and causing the problems that we see.

 The good news: This should be fixable but we will have to add in a hackish
 special case in Parrot_ex_throw_from_op to deal with PIR subclasses. I'll
 try to work on that tonight.

 The better news: This problem should disappear entirely once we've turned
 Contexts into PMCs. See r596 for detail about that project.

 There are several tickets like this: Where a PIR subclass of a built-in
 PMC type cannot properly inherit methods, and I think we should check the
 inheritance tree for non-inheritable ATTRs that might be the problem.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/154#comment:11>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to