On Mie. Jun. 11 06:48:06 2008, bacek wrote:
> Trivial reproducible bug: in rakudo 'say 1 ~~ Perl6Scalar'.
>
> There is patch for src/ops/object.ops
I tried another way: less checks, not more. See attached patch.
$ ./perl6 -e'say 1 ~~ Perl6Scalar'
Null PMC access in invoke()
current instr.: 'infix:~~' pc 8890 (src/gen_builtins.pir:5982)
called from Sub '_block11' pc 44 (EVAL_12:21)
called from Sub 'parrot;PCT::HLLCompiler;eval' pc 783
(src/PCT/HLLCompiler.pir:458)
called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1282
(src/PCT/HLLCompiler.pir:685)
called from Sub 'parrot;Perl6::Compiler;main' pc 11068 (perl6.pir:186)
Index: src/ops/object.ops
===================================================================
--- src/ops/object.ops (revisión: 28239)
+++ src/ops/object.ops (copia de trabajo)
@@ -61,18 +61,6 @@
opcode_t *dest = NULL;
interp->current_args = current_args;
- if (PMC_IS_NULL(method_pmc)) {
- PMC * const _class = VTABLE_get_class(interp, object);
-
- if (PMC_IS_NULL(_class))
- real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found for non-object", meth);
- else
- real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found for invocant of class '%Ss'", meth,
- VTABLE_get_string(interp, _class));
- }
-
interp->current_object = object;
interp->current_cont = NEED_CONTINUATION;
dest = VTABLE_invoke(interp, method_pmc, next);
@@ -104,12 +92,6 @@
opcode_t *dest = NULL;
interp->current_args = current_args;
-
- if (PMC_IS_NULL(method_pmc)) {
- real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found for invocant of class '%Ss'", meth,
- VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
- }
interp->current_object = object;
interp->current_cont = $3;
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
@@ -137,11 +119,6 @@
opcode_t *dest;
- if (PMC_IS_NULL(method_pmc)) {
- real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found for invocant of class '%Ss'", meth,
- VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
- }
interp->current_cont = CONTEXT(interp)->current_cont;
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
interp->current_object = object;