Skip to content

Commit

Permalink
Bug found by Nick Glencross <nickg@glencros.demon.co.uk>
Browse files Browse the repository at this point in the history
Added test.


git-svn-id: https://svn.parrot.org/parrot/trunk@1610 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Daniel Grunblatt committed Jun 5, 2002
1 parent 2d68e7e commit 21e7d99
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core.ops
Expand Up @@ -757,7 +757,7 @@ inline op set (out PMC, in STR, in PMC) {

MAKE_KEY(key, $2, enum_key_string, struct_val);

$1->vtable->set_pmc_keyed(interpreter, $1, &key, $3, NULL);
$1->vtable->set_pmc_keyed(interpreter, $1, NULL, $3, &key);
goto NEXT();
}

Expand Down
2 changes: 1 addition & 1 deletion ops/core.ops
Expand Up @@ -757,7 +757,7 @@ inline op set (out PMC, in STR, in PMC) {

MAKE_KEY(key, $2, enum_key_string, struct_val);

$1->vtable->set_pmc_keyed(interpreter, $1, &key, $3, NULL);
$1->vtable->set_pmc_keyed(interpreter, $1, NULL, $3, &key);
goto NEXT();
}

Expand Down
17 changes: 16 additions & 1 deletion t/pmc/perlhash.t
@@ -1,6 +1,6 @@
#! perl

use Parrot::Test tests => 10;
use Parrot::Test tests => 11;
use Test::More;

output_is(<<'CODE', <<OUTPUT, "simple set / get");
Expand Down Expand Up @@ -288,4 +288,19 @@ CODE
done
OUTPUT

output_is(<<CODE, <<OUTPUT, "String as keys");
new P0,.PerlHash
new P1,.PerlArray
new P2,.PerlArray
set P1[4],"string"
set P0,"one",P1
set P2,P0,"one"
set S0,P2[4]
print S0
print "\\n"
end
CODE
string
OUTPUT

1;

0 comments on commit 21e7d99

Please sign in to comment.