[PATCH] Parrot_load_bytecode segfaults on missing file

0 views
Skip to first unread message

Bob Rogers

unread,
May 6, 2005, 9:44:09 PM5/6/05
to perl6-i...@perl.org
The patch below generates an internal exception instead of SEGV, but
this results in two error messages, because Parrot_readbc will have
already printed its own.

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

------------------------------------------------------------------------
Index: packfile.c
===================================================================
--- packfile.c (revision 7992)
+++ packfile.c (working copy)
@@ -3078,6 +3078,10 @@
ext = strrchr(filename, '.');
if (ext && strcmp (ext, ".pbc") == 0) {
pf = PackFile_append_pbc(interpreter, filename);
+ if (!pf) {
+ internal_exception(1, "Couldn't find PBC file");
+ return;
+ }
do_sub_pragmas(interpreter, pf->cur_cs, PBC_LOADED);
}
else {

Leopold Toetsch

unread,
May 7, 2005, 7:55:32 AM5/7/05
to Bob Rogers, perl6-i...@perl.org
Bob Rogers <rogers...@rgrjr.dyndns.org> wrote:
> The patch below generates an internal exception instead of SEGV, but
> this results in two error messages, because Parrot_readbc will have
> already printed its own.

Thanks, applied.
leo

Reply all
Reply to author
Forward
0 new messages