Short-circuit expressions leak list context through scalar prototypes
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Perl
- Sterne
- 65
- Forks
- 8
- Ø Merge
- 6 Std. 28 Min.
- Gemergte PRs (30 T.)
- 184
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus fglock/PerlOnJava
-
area:runtime documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
fglock/PerlOnJava#1579 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
fglock/PerlOnJava#1885 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:performance enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
fglock/PerlOnJava#1863 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:memory area:performance area:runtime bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
fglock/PerlOnJava#1860 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Mojolicious controller and WebSocket lifetimes regress with #1642 integrationEvtl. vergeben @fglock hat das vor 7 Tagen übernommen. Offenarea:backend area:memory area:runtime bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 12/100
fglock/PerlOnJava#1794 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in fglock/PerlOnJava
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
beyondgrep/ack3#413 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
-
Type: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
inverse-inc/packetfence#9605 ·
Maintainer antworten meist innerhalb von 10 Tagen