On Thu, May 01, 2008 at 11:40:43PM -0700, chromatic wrote:
> When you try to invoke a sub that doesn't exist, Parrot currently gives the 
> unhelpful error message "Null PMC access in invoke()".  Sometimes you can 
> figure out what's wrong given the backtrace.  Often you can't.

Just a quick note here to link this thread to RT#49972, which
has a similar discussion.

> ...
> The attached patch -- for discussion only -- adds an experimental op which 
> performs the lookup and throws an exception if the sub is PMCNULL.  Nothing 
> else uses this op, and it doesn't perturb the existing find_name op, which is 
> important.
> 
> If the op goes away in the future or if there's an easier way to emit this 
> error message, that's fine, but I do suggest that adding this error message 
> improves debuggability.

+1 on all counts.  This is extremely important for debugging programs
written in HLLs.  Important enough, in fact, that I was going to
modify PCT so that the code it generates for subroutine calls
would also check for null subs and throw an exception if they don't
exist.  But I think having Parrot do this automatically is superior
to trying to handle it in generated code -- even though it means
adding a special "find_name_not_null" opcode.

I'd like to see this patch or something like it applied relatively
soon.  If it's not likely to happen within the next week or so, then 
I'll go ahead with my plan to resolve the issue from within PCT until
Parrot does have a good solution.

Thanks!

Pm

Reply via email to