Short-circuit expressions leak list context through scalar prototypes
维护者通常 1 天内回复
评估
调研方向
Start with the prototype parsing path that reparses parenthesized low-precedence expressions, then run the focused regression prototype_parenthesized_and_argument.t on both JVM and interpreter backends. Compare the argument count and values with system Perl’s scalar-prototype behavior; done means the regression and the two upstream t/use.t assertions pass on both backends.
由索引模型根据 Issue 内容生成。
描述
Summary
Short-circuit expressions passed to scalar-prototype arguments can retain list context in PerlOnJava. This causes the upstream GMail-Checker-1.04 test t/use.t to fail both assertions under Test::ok ($;$$).
Reproducer
use strict;
use warnings;
use Test;
BEGIN { plan tests => 1 }
our @args;
sub capture ($;$$) { @args = @_ }
my $object = bless {}, 'Example';
capture (defined($object) and (ref $object, 'new() is ok'));
print scalar(@args), "|", join('|', @args), "\n";
System Perl treats the parenthesized short-circuit expression as one scalar-prototype argument. PerlOnJava previously passed two values, so the and expression's list-valued right side escaped into the call argument list.
Evidence
- CPAN distribution:
GMail-Checker1.04, CPAN run20261026-163826-15395. - System Perl 5.42.2 on macOS: upstream
t/use.tpasses (2/2). - PerlOnJava 5.44.1 on the JVM and interpreter backends: upstream
t/use.tfailed (0/2) before the fix. - The focused regression
prototype_parenthesized_and_argument.tfailed on the JVM before the fix and passes on both backends after it. - The distribution is pure Perl and needs no Gmail credentials for these two tests.
The fix preserves scalar context when prototype parsing reparses a parenthesized low-precedence expression.
- 主要语言
- Perl
- 星标
- 65
- 派生
- 8
- 平均合并
- 6 小时 6 分钟
- 30 天内合并 PR
- 185
环境准备
- 提供 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 天内回复
-
CPAN: Lingua-ZH-Romanize-Pinyin build skips generated dictionaries and rejects $] test guard可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area:cpan-port area:parser bug
难度 5/5 一周以上 新手友好度 35/100
fglock/PerlOnJava#1919 ·
维护者通常 1 天内回复
-
area:performance enhancement
难度 5/5 一周以上 新手友好度 35/100
fglock/PerlOnJava#1911 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
fglock/PerlOnJava#1885 ·
维护者通常 1 天内回复
-
area:cpan-port enhancement help wanted
难度 4/5 3-5 天 新手友好度 45/100
fglock/PerlOnJava#1880 · 2 条评论 ·
维护者通常 1 天内回复
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
-
Type: Bug
难度 2/5 1-3 小时 新手友好度 78/100
inverse-inc/packetfence#9605 ·
维护者通常 10 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
RotherOSS/otobo#6344 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
darold/pgFormatter#426 ·