At 22:37 on 02/06/2002 EST, Jason Gloudon <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 06, 2002 at 12:09:22PM -0800, Steve Fink wrote:
>
> > but I think that's because re_backtrack returns a void*. run_native()
> > returns an opcode_t*, which is fine for the regular core_ops.c but
> > gets returned as void** in core_ops_prederef.c. I think the computed
> > goto path does a third thing, but I don't know how to invoke that.
>
> goto ADDRESS() for prederef needs the same type of calculation that expr_pop
> uses to convert opcode_t * values to the corresponding void **.
>
> CGoto is used by pbc2c.pl. There isn't actually a computed goto runops at the
> moment. Enternative is only used by the C programs pbc2c generates. This code
> doesn't enable prederef (no option parsing), so enternative in prederef mode
> isn't possible yet.
OK. As I lack the knowledge to actually do it right, here's a patch which
just makes it compile and (hopefully) makes it obvious that this needs to
be fixed later if this op is to work.
Index: lib/Parrot/OpTrans/CPrederef.pm
===================================================================
RCS file: /home/perlcvs/parrot/lib/Parrot/OpTrans/CPrederef.pm,v
retrieving revision 1.5
diff -u -r1.5 CPrederef.pm
--- lib/Parrot/OpTrans/CPrederef.pm 15 Jan 2002 16:10:46 -0000 1.5
+++ lib/Parrot/OpTrans/CPrederef.pm 7 Feb 2002 06:16:21 -0000
@@ -69,6 +69,10 @@
return "return cur_opcode + $offset";
}
+sub goto_address {
+ return "return NULL; /* THIS IS BROKEN, but this op is for pbc2c.pl, so pre
deref isn't used yet. */";
+}
+
#
# access_arg()
#-