Short-circuit expressions leak list context through scalar prototypes
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
調査の方向性
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分
- マージ済み PR(30日)
- 185
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:cpan-port area:parser bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fglock/PerlOnJava#1919 ·
メンテナーはふだん 1 日以内に返信
-
area:performance enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 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 ·