Ticket #11 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

issame fails for String PMC argument

Reported by: pmichaud Owned by:
Priority: minor Milestone:
Component: core Version: trunk
Severity: low Keywords:
Cc: Language:
Patch status: Platform:

Description

The issame opcode fails when comparing a String PMC with PMCNULL:

$ cat x.pir
.sub main
    $P0 = new 'String'
    assign $P0, 'foo'

    null $P1
    $I0 = issame $P0, $P1

    say $I0
.end
$ ./parrot x.pir
Null PMC access in get_string()
current instr.: 'main' pc 8 (x.pir:6)
$

Change History

Changed 6 years ago by pmichaud

  • component changed from none to core

Changed 6 years ago by pmichaud

Note that issame properly compares with null against a Sub PMC:

$ cat y.pir
.sub main
    $P0 = get_global 'main'
    null $P1
    $I0 = issame $P0, $P1
    say $I0
.end


$ ./parrot y.pir
0
$

Changed 6 years ago by pmichaud

  • priority changed from major to minor
  • severity changed from medium to low

Julian Albo resolves my original issue in r33452, but I still have questions about whether the String PMC needs a special is_same vtable function instead of simply using the default. (See  http://lists.parrot.org/pipermail/parrot-dev/2008-December/000435.html.)

As I note in the parrot-dev message, removing the is_same vtable function from string.pmc doesn't cause any tests to fail, so either (1) the special code isn't needed and we should remove it, or (2) we're inadequately testing the feature. Thus I'm leaving this ticket open at a lower priority until we resolve that issue.

Pm

Changed 6 years ago by allison

  • status changed from new to closed
  • resolution set to fixed

The answer is no, we really don't need to check whether two string PMCs are sharing the same internal string memory. This is an old C-centric concept of "sameness" that's not relevant anymore. I've removed String's 'is_same' vtable function in r36078.

Allison

Note: See TracTickets for help on using tickets.