Re: [PHP-CVS] com php-src: Fix non-specialized executor build: Zend/zend_vm_def.h

2013-06-21 Thread Ard Biesheuvel
On 20 June 2013 23:28, Christopher Jones christopher.jo...@oracle.com wrote:
 Your @internals mail said building the executor without
 specialization is broken so the patch seems like a standard bug fix
 that should be merged to 5.4  5.5.


By 'building' I mean running 'zend_vm_gen.php --without-specializer'
to generate zend_vm_opcodes.h and zend_vm_execute.h, which is a way
that is arguably non-standard, proven by the fact that this particular
mode has been broken since November 2010. In fact, when running this
script in the conventional way, the produced code is identical to the
code that is already in the repository.

@Dmitry: there's a request to backport the FREE_OP2() fixes to 5.5 and
5.4, what do you think?

-- 
Ard.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Fix non-specialized executor build: Zend/zend_vm_def.h

2013-06-21 Thread Dmitry Stogov
I think it's better to apply the same patch to 5.4 and 5.5 as well.
It's absolutely safe.

Thanks. Dmitry.


On Fri, Jun 21, 2013 at 12:51 PM, Ard Biesheuvel
ard.biesheu...@linaro.orgwrote:

 On 20 June 2013 23:28, Christopher Jones christopher.jo...@oracle.com
 wrote:
  Your @internals mail said building the executor without
  specialization is broken so the patch seems like a standard bug fix
  that should be merged to 5.4  5.5.
 

 By 'building' I mean running 'zend_vm_gen.php --without-specializer'
 to generate zend_vm_opcodes.h and zend_vm_execute.h, which is a way
 that is arguably non-standard, proven by the fact that this particular
 mode has been broken since November 2010. In fact, when running this
 script in the conventional way, the produced code is identical to the
 code that is already in the repository.

 @Dmitry: there's a request to backport the FREE_OP2() fixes to 5.5 and
 5.4, what do you think?

 --
 Ard.



[PHP-CVS] com php-src: Fix non-specialized executor build: Zend/zend_vm_def.h

2013-06-21 Thread Ard Biesheuvel
Commit:8623562b02dd6759617ef78ddcb06bdfe7710329
Author:Ard Biesheuvel ard.biesheu...@linaro.org Fri, 21 Jun 2013 
11:07:30 +0200
Parents:   f5c7fe92020fd7b8e81c94658da4813a7e6dea17
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8623562b02dd6759617ef78ddcb06bdfe7710329

Log:
Fix non-specialized executor build

Removed a couple of calls to FREE_OP2() that were left behind in
the handlers for break and continue opcodes after commit 7628da98

Changed paths:
  M  Zend/zend_vm_def.h


Diff:
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 15cef71..3d84a37 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -3268,7 +3268,6 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num,
   EX(op_array), EX_Ts() TSRMLS_CC);
-   FREE_OP2();
ZEND_VM_JMP(EX(op_array)-opcodes + el-brk);
 }
 
@@ -3280,7 +3279,6 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num,
   EX(op_array), EX_Ts() TSRMLS_CC);
-   FREE_OP2();
ZEND_VM_JMP(EX(op_array)-opcodes + el-cont);
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_vm_def.h

2013-06-21 Thread Ard Biesheuvel
Commit:162726241ccfa567b3867a10f1f7ec6fa365533c
Author:Ard Biesheuvel ard.biesheu...@linaro.org Fri, 21 Jun 2013 
11:26:37 +0200
Parents:   c65d663aefd27e39006b9c20a665893aa5265ed4 
8623562b02dd6759617ef78ddcb06bdfe7710329
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=162726241ccfa567b3867a10f1f7ec6fa365533c

Log:
Merge branch 'PHP-5.4' into PHP-5.5

Conflicts:
Zend/zend_vm_def.h

Changed paths:
  MM  Zend/zend_vm_def.h


Diff:
diff --cc Zend/zend_vm_def.h
index ca62dde,3d84a37..9986e20
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -3295,8 -3267,7 +3295,7 @@@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONS
  
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num,
 - EX(op_array), EX_Ts() TSRMLS_CC);
 + EX(op_array), execute_data TSRMLS_CC);
-   FREE_OP2();
ZEND_VM_JMP(EX(op_array)-opcodes + el-brk);
  }
  
@@@ -3307,8 -3278,7 +3306,7 @@@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CON
  
SAVE_OPLINE();
el = zend_brk_cont(Z_LVAL_P(opline-op2.zv), opline-op1.opline_num,
 - EX(op_array), EX_Ts() TSRMLS_CC);
 + EX(op_array), execute_data TSRMLS_CC);
-   FREE_OP2();
ZEND_VM_JMP(EX(op_array)-opcodes + el-cont);
  }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Fix non-specialized executor build: Zend/zend_vm_def.h

2013-06-21 Thread Ard Biesheuvel
On 21 June 2013 11:01, Dmitry Stogov dmi...@zend.com wrote:
 I think it's better to apply the same patch to 5.4 and 5.5 as well.
 It's absolutely safe.


OK done!

-- 
Ard.



 Thanks. Dmitry.


 On Fri, Jun 21, 2013 at 12:51 PM, Ard Biesheuvel ard.biesheu...@linaro.org
 wrote:

 On 20 June 2013 23:28, Christopher Jones christopher.jo...@oracle.com
 wrote:
  Your @internals mail said building the executor without
  specialization is broken so the patch seems like a standard bug fix
  that should be merged to 5.4  5.5.
 

 By 'building' I mean running 'zend_vm_gen.php --without-specializer'
 to generate zend_vm_opcodes.h and zend_vm_execute.h, which is a way
 that is arguably non-standard, proven by the fact that this particular
 mode has been broken since November 2010. In fact, when running this
 script in the conventional way, the produced code is identical to the
 code that is already in the repository.

 @Dmitry: there's a request to backport the FREE_OP2() fixes to 5.5 and
 5.4, what do you think?

 --
 Ard.



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Fixed Bug #65060 imagecreatefrom... crashes with user streams Fixed Bug #65084 imagecreatefromjpeg fails with URL: NEWS ext/gd/gd.c

2013-06-21 Thread Remi Collet
Commit:fc898ee0f94ee3686aa1f359d4a973d5e8e1754b
Author:Remi Collet r...@php.net Fri, 21 Jun 2013 14:11:04 +0200
Parents:   162726241ccfa567b3867a10f1f7ec6fa365533c
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fc898ee0f94ee3686aa1f359d4a973d5e8e1754b

Log:
Fixed Bug #65060 imagecreatefrom... crashes with user streams
Fixed Bug #65084 imagecreatefromjpeg fails with URL

Regression introduced in 8a90aad (drop of USE_GD_IOCTX)
Secure with php_stream_can_cast to avoid segfault in php_stream_cast.
(encountered when imagecreatefromxpm with URL)

Bugs:
https://bugs.php.net/65060
https://bugs.php.net/65084

Changed paths:
  M  NEWS
  M  ext/gd/gd.c


Diff:
diff --git a/NEWS b/NEWS
index d8b74c2..577d2e4 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP 
   NEWS
 - GD
   . Fixed #65070 (bgcolor does not use the same format as the input image with
 imagerotate). (Pierre)
+  . Fixed Bug #65060 (imagecreatefrom... crashes with user streams). (Remi)
+  . Fixed Bug #65084 (imagecreatefromjpeg fails with URL). (Remi)
 
 20 Jun 2013, PHP 5.5.0
 
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 4ebac94..21aa9e2 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -2361,13 +2361,12 @@ static void 
_php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
}
 
+
stream = php_stream_open_wrapper(file, rb, 
REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
if (stream == NULL) {
RETURN_FALSE;
}
 
-   ioctx_func_p = NULL; /* don't allow sockets without IOCtx */
-
if (image_type == PHP_GDIMG_TYPE_WEBP) {
size_t buff_size;
char *buff;
@@ -2419,7 +2418,7 @@ static void 
_php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
io_ctx-gd_free(io_ctx);
pefree(buff, 1);
}
-   else {
+   else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO)) {
/* try and force the stream to be FILE* */
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | 
PHP_STREAM_CAST_TRY_HARD, (void **) fp, REPORT_ERRORS)) {
goto out_err;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/gd/gd.c

2013-06-21 Thread Remi Collet
Commit:20dbd2710835bf03a0f8e344e9bd1bbad38e845d
Author:Remi Collet r...@php.net Fri, 21 Jun 2013 14:11:33 +0200
Parents:   9b22faa5b8ea2579f6247e024b0c59fd032a7eed 
fc898ee0f94ee3686aa1f359d4a973d5e8e1754b
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=20dbd2710835bf03a0f8e344e9bd1bbad38e845d

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Fixed Bug #65060 imagecreatefrom... crashes with user streams Fixed Bug 
#65084 imagecreatefromjpeg fails with URL

Bugs:
https://bugs.php.net/65060
https://bugs.php.net/65084

Changed paths:
  MM  ext/gd/gd.c


Diff:



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php