Skip to content

Commit a86e048

Browse files
committed
Merge branch 'PHP-7.4'
2 parents b6d138f + ab4f725 commit a86e048

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ typedef struct _zend_property_info {
369369
#define OBJ_PROP_NUM(obj, num) \
370370
(&(obj)->properties_table[(num)])
371371
#define OBJ_PROP_TO_OFFSET(num) \
372-
((uint32_t)(zend_uintptr_t)OBJ_PROP_NUM(((zend_object*)NULL), num))
372+
((uint32_t)(XtOffsetOf(zend_object, properties_table) + sizeof(zval) * (num)))
373373
#define OBJ_PROP_TO_NUM(offset) \
374374
((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))
375375

Zend/zend_portability.h

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#endif
5656

5757
#include <stdarg.h>
58+
#include <stddef.h>
5859

5960
#ifdef HAVE_DLFCN_H
6061
# include <dlfcn.h>
@@ -327,24 +328,19 @@ char *alloca();
327328

328329
#ifndef XtOffsetOf
329330
# if defined(CRAY) || (defined(__ARMCC_VERSION) && !defined(LINUX))
330-
# ifdef __STDC__
331-
# define XtOffset(p_type, field) _Offsetof(p_type, field)
332-
# else
333-
# ifdef CRAY2
334-
# define XtOffset(p_type, field) \
335-
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
336-
337-
# else /* !CRAY2 */
338-
339-
# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
340-
341-
# endif /* !CRAY2 */
342-
# endif /* __STDC__ */
331+
# ifdef __STDC__
332+
# define XtOffset(p_type, field) _Offsetof(p_type, field)
333+
# else
334+
# ifdef CRAY2
335+
# define XtOffset(p_type, field) \
336+
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
337+
# else /* !CRAY2 */
338+
# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
339+
# endif /* !CRAY2 */
340+
# endif /* __STDC__ */
343341
# else /* ! (CRAY || __arm) */
344-
345-
# define XtOffset(p_type, field) \
346-
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
347-
342+
# define XtOffset(p_type, field) \
343+
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
348344
# endif /* !CRAY */
349345

350346
# ifdef offsetof

ext/standard/image.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
449449
}
450450
length -= 2; /* length includes itself */
451451

452-
buffer = emalloc(length);
452+
buffer = emalloc((size_t)length);
453453

454-
if (php_stream_read(stream, buffer, (zend_long) length) != length) {
454+
if (php_stream_read(stream, buffer, (size_t) length) != length) {
455455
efree(buffer);
456456
return 0;
457457
}

ext/standard/url_scanner_ex.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static int php_url_scanner_ex_activate(int type)
656656
ctx = &BG(url_adapt_output_ex);
657657
}
658658

659-
memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags));
659+
memset(ctx, 0, XtOffsetOf(url_adapt_state_ex_t, tags));
660660

661661
return SUCCESS;
662662
}

sapi/phpdbg/phpdbg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static PHP_MSHUTDOWN_FUNCTION(phpdbg) /* {{{ */
272272
static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
273273
{
274274
/* deactivate symbol table caching to have these properly destroyed upon stack leaving (especially important for watchpoints) */
275-
EG(symtable_cache_limit) = EG(symtable_cache) - 1;
275+
EG(symtable_cache_limit) = EG(symtable_cache);
276276

277277
return SUCCESS;
278278
} /* }}} */

0 commit comments

Comments
 (0)