Am 24.03.2011 05:00, schrieb Timothy Bollman (via RT):
Location of Error:
Grammar.pm line 2158 (as of ~5:00 AM UTC on March 23):
if +@parts != 2 {
     self.panic("Unable to find starter and stopper from '$opname'");
}


Short description of error:
self.panic isn't... panicking.

Thanks for the report. I've committed a partial fix: https://github.com/rakudo/rakudo/commit/792e8602e8f9fa4f95463a54ea33467630d22d17


I was happily making a program that needed a floor operator.  So I
figured I would define a circumfix floor operator using the unicode
symbols.  But I didn't put a space between the two ends (having never
created one before I was guessing on how to write it).  Alas, I got
"Null PMC access in get_integer" thrown in my face.  Once I had
> traced it down to that space, I declared "ah! That's an easy enough
thing to check for.  Easy patch".  A short grep later, I found the
gen_op function in Grammar.pm and lo and behold, it was already checking
for this error.  I put in  a debug say and it's getting to the check,
so the logical conclusion is that the panic method isn't functioning
like the developer expected (like perhaps it's not leaving the function).

The problem with method gen_op is that it has a rather indirect call chain, which seems to lose the context information. So when the .panic call tries to include the current location, it gets a Null PMC instead of the index into the string that is being parsed.

I don't understand the call mechanism sufficiently well to fix it, so I've just added a pir::die. So now you get the correct message, but no file and line number.

Cheers,
Moritz

Reply via email to