Skip to content

Commit

Permalink
Fix nextwitha and callwith.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jul 8, 2009
1 parent e249a62 commit 116fa46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/builtins/control.pir
Expand Up @@ -444,7 +444,8 @@ on error.
.local pmc clist, lexpad, self, next
get_next_candidate_info clist, $P0, lexpad
next = clist.'get'()
$I0 = isa next, 'Method'
$P0 = deref next
$I0 = isa $P0, 'Method'
unless $I0 goto not_method
self = lexpad['self']
.tailcall next(self, pos_args :flat, named_args :flat :named)
Expand All @@ -466,7 +467,8 @@ on error.
.local pmc clist, lexpad, self, next, result
get_next_candidate_info clist, $P0, lexpad
next = clist.'get'()
$I0 = isa next, 'Method'
$P0 = deref next
$I0 = isa $P0, 'Method'
unless $I0 goto not_method
self = lexpad['self']
(result) = next(self, pos_args :flat, named_args :flat :named)
Expand Down
9 changes: 9 additions & 0 deletions src/pmc/p6invocation.pmc
Expand Up @@ -170,6 +170,15 @@ pmclass P6Invocation need_ext dynpmc group perl6_group {
GETATTR_P6Invocation_position(interp, SELF, position);
return position < VTABLE_elements(interp, candidates);
}

VTABLE PMC *get_pmc() {
PMC *first_candidate;
PMC *clone = VTABLE_clone(interp, SELF);
GETATTR_P6Invocation_first_candidate(interp, clone, first_candidate);
if (PMC_IS_NULL(first_candidate))
first_candidate = get_next_candidate(interp, clone);
return first_candidate;
}

VTABLE opcode_t *invoke(void *next) {
STRING *lexname = CONST_STRING(interp, "__CANDIDATE_LIST__");
Expand Down

0 comments on commit 116fa46

Please sign in to comment.