Author: leo
Date: Sat May 7 04:54:44 2005
New Revision: 7999
Modified:
trunk/src/packfile.c
Log:
Parrot_load_bytecode segfaults on missing file
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.
Courtesy of Bob Rogers <[EMAIL PROTECTED]>
Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c (original)
+++ trunk/src/packfile.c Sat May 7 04:54:44 2005
@@ -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 {