Autovivify undefined hash reference in list assignment
Mantenedores costumam responder em até 1 dia
Um pull request relacionado já foi integrado.
- #1960 de @fglock — integrado
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 55/100
Direção de pesquisa
Start by tracing shared list assignment for a hash dereference in the PerlOnJava runtime, then compare how both the JVM and interpreter backends handle an undefined scalar against an initialized hash reference. Add a focused regression for both cases; done means the reproducer passes on both backends, including the existing initialized-reference behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
List assignment into a hash dereference does not autovivify an undefined scalar on either PerlOnJava backend. This breaks pure-Perl code that initializes a hash reference with ($self, %$type) = @_ and then reads it.
Reproducer
my ($self, $type);
($self, %$type) = ('Object::Hybrid', reftype => 'HASH', tieable => 0, mutable => 0, caller => 0);
die "missing hash assignment" unless $type->{reftype} eq 'HASH';
System Perl 5.42.2 passes. PerlOnJava at master b43a65250 leaves $type undefined and the key missing on both the JVM and interpreter backends. Initializing $type to {} before the assignment makes both PerlOnJava backends pass.
CPAN evidence
Object-Hybrid 0.07 passed all 909 tests under system Perl. CPAN run 20261103-123832-91742 failed at t/Object-Hybrid.t line 21 after its first assertion, with No 'reftype' parameter specified; the same failure reproduces on both PerlOnJava backends.
Suspected runtime path
The failure is in shared list assignment to a hash dereference. The assignment replaces the pending autovivification hash before the referenced scalar becomes a hash reference. A focused regression should cover the undefined-scalar case and continue to pass when the hash reference is already initialized.
- Linguagem predominante
- Perl
- Estrelas
- 65
- Forks
- 8
- Merge médio
- 5h 57min
- PRs com merge (30d)
- 177
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fglock/PerlOnJava
-
area:runtime documentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#1579 ·
Mantenedores costumam responder em até 1 dia
-
Honor scalar context for sort returned from a subroutineTalvez já em andamento @fglock assumiu hoje. Abertaarea:runtime bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 25/100
fglock/PerlOnJava#1991 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port area:parser bug
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
fglock/PerlOnJava#1990 ·
Mantenedores costumam responder em até 1 dia
-
area:parser area:unicode bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
fglock/PerlOnJava#1989 ·
Mantenedores costumam responder em até 1 dia
-
area:backend bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
fglock/PerlOnJava#1981 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fglock/PerlOnJava
Issues semelhantes
-
check_keywords.pl dies before reporting an unknown keyword categoryTalvez já em andamento @zhaohai666 assumiu há 1 dia. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 87/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
wave-followup
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100