Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Short-circuit expressions leak list context through scalar prototypes

Đã đóng
#1,891 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@fglock đang làm issue này rồi.

Từ ngày 27/10/2026.

  • #1893 của @fglock — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
compilers, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:parser bug

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-Checker 1.04, CPAN run 20261026-163826-15395.
  • System Perl 5.42.2 on macOS: upstream t/use.t passes (2/2).
  • PerlOnJava 5.44.1 on the JVM and interpreter backends: upstream t/use.t failed (0/2) before the fix.
  • The focused regression prototype_parenthesized_and_argument.t failed 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.

Ngôn ngữ chính
Perl
Star
65
Fork
8
Merge trung bình
6 giờ 6 phút
Pull request đã merge (30 ngày)
185

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.