Author: leo
Date: Mon Mar 13 09:04:03 2006
New Revision: 11886
Modified:
trunk/src/pmc/closure.pmc
Log:
enable Closure.set_pointer
Modified: trunk/src/pmc/closure.pmc
==============================================================================
--- trunk/src/pmc/closure.pmc (original)
+++ trunk/src/pmc/closure.pmc Mon Mar 13 09:04:03 2006
@@ -66,6 +66,10 @@
/*
+=item C<void set_pointer(void *value)>
+
+Sets the address to the closure entry.
+
=item C<void* invoke(void* next)>
Invokes the closure.
@@ -74,6 +78,12 @@
*/
+ void set_pointer (void* value) {
+ struct Parrot_sub * sub = PMC_sub(SELF);
+ opcode_t *addr = value;
+ sub->start_offs = addr - sub->seg->base.data;
+ }
+
void* invoke (void* next) {
struct Parrot_sub * sub = PMC_sub(SELF);
PMC *cont, *outer_sub;
@@ -86,8 +96,8 @@
*/
sub->ctx->outer_ctx = sub->outer_ctx;
}
- else if ((PObj_get_FLAGS(outer_sub) & SUB_FLAG_IS_OUTER &&
- PMC_sub(outer_sub)->ctx)) {
+ else if ((PObj_get_FLAGS(outer_sub) & SUB_FLAG_IS_OUTER) &&
+ PMC_sub(outer_sub)->ctx) {
/* the sub was invoked earlier - it still has the context
* due to the SUB_FLAG_IS_OUTER flag
*/