Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

[perl #41771] Uncaught Parse Error Leads to Segfault

5 vues
Accéder directement au premier message non lu

Chromatic

non lue,
10 mars 2007, 04:20:4510/03/2007
à bugs-bi...@rt.perl.org
# New Ticket Created by chromatic
# Please include the string: [perl #41771]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41771 >


This code causes a segfault:

.sub test :main
get_results '(0)'
.end

From my reading of src/ops/core.ops, this is invalid syntax. From my reading
of IMCC's parser, there's no easy way to catch this. A correct invocation is
more likely:

.sub test :main
get_results '(0)', P1
# or
get_results '()'
.end

It's possible to add a null guard in compilers/imcc/pbc.c:1120, but I think
that's the wrong fix; the parser should warn on the error here.

-- c

Bob Rogers

non lue,
11 mars 2007, 01:28:3511/03/2007
à perl6-i...@perl.org,bugs-bi...@rt.perl.org
From: chromatic (via RT) <parrotbug...@parrotcode.org>
Date: Sat, 10 Mar 2007 01:20:45 -0800

# New Ticket Created by chromatic
# Please include the string: [perl #41771]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41771 >

This code causes a segfault:

.sub test :main
get_results '(0)'
.end

From my reading of src/ops/core.ops, this is invalid syntax . . .

It's possible to add a null guard in compilers/imcc/pbc.c:1120, but I think
that's the wrong fix; the parser should warn on the error here.

-- c

This is the same issue as "#41097: Segfault in malformed get_results".
Detecting this as a syntax error is ideal, but it occurs to me that it
would also be a good idea to guard against malformed bytecode, lest it
become a security issue down the road.

-- Bob Rogers
http://rgrjr.dyndns.org/

0 nouveau message