Skip to content

Commit 9c354ba

Browse files
committed
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: Better fix for #68601 for perf https://bitbucket.org/libgd/gd-libgd/commits/81e9a993f2893d651d225646378e3fd1b7465467 Added EXPECTED(). Most functions have arguments.
2 parents 3b6a8b1 + f610712 commit 9c354ba

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
192192
{
193193
uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
194194

195-
if (num_args > 0) {
195+
if (EXPECTED(num_args > 0)) {
196196
zval *end = ZEND_CALL_ARG(call, 1);
197197
zval *p = end + num_args;
198198

ext/gd/libgd/gd_gif_in.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@ GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroD
400400
scd->lastbit = (2+count)*8 ;
401401
}
402402

403-
ret = 0;
404-
for (i = scd->curbit, j = 0; j < code_size; ++i, ++j)
405-
if (i < CSD_BUF_SIZE * 8) {
403+
if ((scd->curbit + code_size - 1) >= (CSD_BUF_SIZE * 8)) {
404+
ret = -1;
405+
} else {
406+
ret = 0;
407+
for (i = scd->curbit, j = 0; j < code_size; ++i, ++j) {
406408
ret |= ((scd->buf[i / 8] & (1 << (i % 8))) != 0) << j;
407-
} else {
408-
ret = -1;
409-
break;
410409
}
410+
}
411411

412412
scd->curbit += code_size;
413413
return ret;

0 commit comments

Comments
 (0)