Skip to content

Commit

Permalink
Fixed issue #1229: Issues with GCC 4.8, which in -O2 move removes som…
Browse files Browse the repository at this point in the history
…e required code

Turned out to be me after all, and not the compiler
  • Loading branch information
derickr committed Dec 16, 2015
1 parent c311b18 commit c36ea38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
22 changes: 0 additions & 22 deletions config.m4
Expand Up @@ -5,28 +5,6 @@ PHP_ARG_ENABLE(xdebug, whether to enable Xdebug support,
[ --enable-xdebug Enable Xdebug support])

if test "$PHP_XDEBUG" != "no"; then
dnl disabling -O2 for GCC 4.8
AS_IF([test "x$GCC" = "xyes"],[
AS_IF([test x`${CC} --version | ${AWK} '/(gcc|cc)/ { print "gcc" }'` = "xgcc"],[
AC_CACHE_CHECK([$CC version],[ax_cv_xdebug_gcc_version],[
ax_cv_xdebug_gcc_version="`$CC -dumpversion`"
AS_IF([test "x$ax_cv_xdebug_gcc_version" = "x"],[
ax_cv_xdebug_gcc_version=""
])
])
XDEBUG_GCC_VERSION=$ax_cv_xdebug_gcc_version
XDEBUG_GCC_VERSION_MAJOR=$(echo $XDEBUG_GCC_VERSION | cut -d'.' -f1)
XDEBUG_GCC_VERSION_MINOR=$(echo $XDEBUG_GCC_VERSION | cut -d'.' -f2)
AS_IF([test "x$XDEBUG_GCC_VERSION_MAJOR" = "x4"],[
AS_IF([test "x$XDEBUG_GCC_VERSION_MINOR" = "x8"],[
AC_MSG_RESULT([disabling optimisation because of GCC 4.8])
CFLAGS=`echo $CFLAGS | sed 's/O2/O0/'`
])
])
])
])

AC_MSG_CHECKING([Check for supported PHP versions])
PHP_XDEBUG_FOUND_VERSION=`${PHP_CONFIG} --version`
PHP_XDEBUG_FOUND_VERNUM=`echo "${PHP_XDEBUG_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
Expand Down
3 changes: 2 additions & 1 deletion xdebug_var.c
Expand Up @@ -986,6 +986,7 @@ void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval,
zend_ulong num;
zend_string *key;
zval *val;
zval *tmpz;
#endif

if (!struc || !(*struc)) {
Expand All @@ -1001,7 +1002,7 @@ void xdebug_var_export(zval **struc, xdebug_str *str, int level, int debug_zval,
}
}
if (Z_TYPE_P(*struc) == IS_REFERENCE) {
zval *tmpz = &((*struc)->value.ref->val);
tmpz = &((*struc)->value.ref->val);
struc = &tmpz;
}
#else
Expand Down

0 comments on commit c36ea38

Please sign in to comment.