Ticket #2103 (new bug)

Opened 11 years ago

Last modified 11 years ago

cmp_pmc not working in extend_vtable

Reported by: dukeleto Owned by:
Priority: normal Milestone:
Component: core Version: 3.2.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

The error

#   Failed test 'Parrot_PMC_cmp_pmc'
#   at t/src/extend_vtable.t line 155.
#          got: 'Failed!
# Exception is: type 44 severity 2 message 'Multiple Dispatch: No suitable candidate found for 'cmp_pmc', with signature 'PP->P''
# '
#     expected: '1
# -1
# 0
# Done!
# '

is produced, even though the signature of cmp_pmc is PP->P as far as I can tell:

src/pmc/default.pmc:1850:    VTABLE PMC *cmp_pmc(PMC *value) {
src/pmc/default.pmc-1851-        PMC *retval;
src/pmc/default.pmc-1852-
src/pmc/default.pmc-1853-        /* Don't multidispatch if you've got two pointers to the same PMC. They
src/pmc/default.pmc-1854-         * are equal. */
src/pmc/default.pmc-1855-        if (SELF == value)
src/pmc/default.pmc-1856-            return NULL;
src/pmc/default.pmc-1857-
src/pmc/default.pmc-1858-        Parrot_mmd_multi_dispatch_from_c_args(INTERP,
src/pmc/default.pmc:1859:                "cmp_pmc", "PP->P", SELF, value, &retval);
src/pmc/default.pmc-1860-
src/pmc/default.pmc-1861-        return retval;

Change History

Changed 11 years ago by dukeleto

The test in question can be seen here:

 https://github.com/parrot/parrot/commit/e71819b14e4b33ea3ebc2bb3364e64ba6b588dc0

All the PMCs in question are Integer PMCs.

Changed 11 years ago by jkeenan

  • component changed from none to core

Changed 11 years ago by NotFound

Note that this pir program

.sub main :main
    .local pmc r, i1, i2
    i1 = new ['Integer'], 42
    i2 = new ['Integer'], 17
    r = cmp_pmc i1, i2
.end

also gives:

Multiple Dispatch: No suitable candidate found for 'cmp_pmc', with signature 'PP->P'

So the problem is not in extend_vtable.

$ ack -w cmp_pmc src/pmc/*.pmc src/dynpmc/*.pmc
src/pmc/default.pmc

Looks line there is no native PMC other than default that implements that vtable.

Note: See TracTickets for help on using tickets.