|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-04-16 07:17 UTC] kepi at igloonet dot cz
Description: ------------ If I'm including empty file in any php script (even if it is not bcompiled) I receive warning: PHP Warning: bcompiler: Bad bytecode file format at 00000000 in file.php on line 1 Thanks for any help, we need to correct this bug on bcompiler side, cause we are hosting company, so make file nonempty is not good solution for us. Reproduce code: --------------- <?php include "empty_file.inc"; ?> Expected result: ---------------- no error Actual result: -------------- PHP Warning: bcompiler: Bad bytecode file format at 00000000 in file.php on line 1 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 31 23:00:01 2025 UTC |
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pecl.php.net. In case this was a pecl.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PECL better. Fixed in CVS (bcompiler.c version 1.110) I also put the patch to fix this bug below: --- bcompiler.c.1 Sun Apr 22 22:21:16 2007 +++ bcompiler.c Sun Apr 22 22:25:20 2007 @@ -2081,7 +2081,12 @@ int len = 0; unsigned int hi, lo; - DESERIALIZE_SCALAR_V(&len, int, -1); + /* do not use macros because of empty file problem (bug #10742) */ + /* DESERIALIZE_SCALAR_V(&len, int, -1); */ + { + size_t act = php_stream_read(BCOMPILERG(stream), &len, BCOMPILERG(bcompiler_stdsize)[BCSI_int]); + if (act != BCOMPILERG(bcompiler_stdsize)[BCSI_int]) return -1; + } /* just a sanity check */ if (len <= 0 || len > 0x20) { return -1;