php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58995 Constant function params still fails
Submitted: 2009-12-17 01:01 UTC Modified: 2009-12-19 20:46 UTC
From: contact at NOSPAM dot swiftlytilting dot com Assigned: val (profile)
Status: Closed Package: bcompiler (PECL)
PHP Version: 5_3.1RC2 OS: Windows xp sp3
Private report: No CVE-ID: None
 [2009-12-17 01:01 UTC] contact at NOSPAM dot swiftlytilting dot com
Description:
------------
Thank you for your quick attention to bug #16978

Unfortunately though it seems the modification made things worse - now you do not have to call the function to cause a crash.

Using constants as default parameter values in function definitions causes bcompiler to crash using  bcompiler_write_file.

I'm using php 5.3.1, bcompiler SVN. 

This does not occur in 0.6, not sure about 0.7 or 0.8 though


Reproduce code:
---------------
<?php
define("SOME_CONST",1);
function foo($var = SOME_CONST)
{ return;
}

?>


Expected result:
----------------
expect bcompiled code to run normally

Actual result:
--------------
crashes

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-17 04:26 UTC] val@php.net
Hmmm... I use the following test script to check my fix:
<?php
define("SOME_CONST",15);
function foo($var = SOME_CONST) { echo "var=$var\n"; }

foo();
?>
with expected output
var=15

It works on my PHP 5.3.2-dev (cli) built from the current SVN sources on Unix. But I will re-check it with a Win32 build.
 [2009-12-17 04:48 UTC] val@php.net
I doesn't reproduce on Win32 with PHP 5.3.1 (cli) (built: Nov 19 2009 10:17:43). Let me send my .dll and bytecode file by e-mail - please test them.
 [2009-12-19 20:46 UTC] contact at NOSPAM dot swiftlytilting dot com
recompiled and problem doesn't exist any more.

thank you for all your assistance.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 18:03:34 2021 UTC