Autovivify undefined hash reference in list assignment
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #1960 来自 @fglock —— 已合并
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Perl
- 星标
- 65
- 派生
- 8
- 平均合并
- 5 小时 57 分钟
- 30 天内合并 PR
- 177
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fglock/PerlOnJava 的其他 Issue
-
area:runtime documentation enhancement
难度 2/5 1-3 小时 新手友好度 72/100
fglock/PerlOnJava#1579 ·
维护者通常 1 天内回复
-
Honor scalar context for sort returned from a subroutine可能已有人在做 @fglock 今天认领。 未关闭area:runtime bug
难度 3/5 1-2 天 新手友好度 25/100
fglock/PerlOnJava#1991 · 1 条评论 ·
维护者通常 1 天内回复
-
area:cpan-port area:parser bug
难度 5/5 一周以上 新手友好度 35/100
fglock/PerlOnJava#1990 ·
维护者通常 1 天内回复
-
area:parser area:unicode bug
难度 4/5 3-5 天 新手友好度 48/100
fglock/PerlOnJava#1989 ·
维护者通常 1 天内回复
-
area:backend bug
难度 4/5 3-5 天 新手友好度 55/100
fglock/PerlOnJava#1981 · 1 条评论 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
check_keywords.pl dies before reporting an unknown keyword category可能已有人在做 @zhaohai666 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 87/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
wave-followup
难度 2/5 1-3 小时 新手友好度 74/100