Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the sigsetjmp change more robust. On systems that don't have

sigsetjmp use setjmp.  Windows is of course weird in that it seems to
have sigsetjmp but not sigjmp_buf (??) so force it to use setjmp in
config.w32.h.in
  • Loading branch information...
commit 10afe5d96bc3d562958e905102de1db44188ac2b 1 parent c9e0781
@rlerdorf rlerdorf authored
View
2  Zend/Zend.m4
@@ -109,7 +109,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
-AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass)
+AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
View
2  Zend/zend.c
@@ -794,7 +794,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
CG(unclean_shutdown) = 1;
CG(in_compilation) = EG(in_execution) = 0;
EG(current_execute_data) = NULL;
- siglongjmp(*EG(bailout), FAILURE);
+ LONGJMP(*EG(bailout), FAILURE);
}
/* }}} */
END_EXTERN_C()
View
16 Zend/zend.h
@@ -520,13 +520,23 @@ END_EXTERN_C()
#define zend_bailout() _zend_bailout(__FILE__, __LINE__)
+#ifdef HAVE_SIGSETJMP
+# define SETJMP(a) sigsetjmp(a, 0)
+# define LONGJMP(a,b) siglongjmp(a, b)
+# define JMP_BUF sigjmp_buf
+#else
+# define SETJMP(a) setjmp(a)
+# define LONGJMP(a,b) longjmp(a, b)
+# define JMP_BUF jmp_buf
+#endif
+
#define zend_try \
{ \
- sigjmp_buf *__orig_bailout = EG(bailout); \
- sigjmp_buf __bailout; \
+ JMP_BUF *__orig_bailout = EG(bailout); \
+ JMP_BUF __bailout; \
\
EG(bailout) = &__bailout; \
- if (sigsetjmp(__bailout, 0)==0) {
+ if (SETJMP(__bailout)==0) {
#define zend_catch \
} else { \
EG(bailout) = __orig_bailout;
View
2  Zend/zend_globals.h
@@ -161,7 +161,7 @@ struct _zend_executor_globals {
HashTable included_files; /* files already included */
- sigjmp_buf *bailout;
+ JMP_BUF *bailout;
int error_reporting;
int orig_error_reporting;
View
1  win32/build/config.w32.h.in
@@ -54,6 +54,7 @@
#define NEED_ISBLANK 1
#define DISCARD_PATH 0
#undef HAVE_SETITIMER
+#undef HAVE_SIGSETJMP
#undef HAVE_IODBC
#define HAVE_LIBDL 1
#define HAVE_GETTIMEOFDAY 1
Please sign in to comment.
Something went wrong with that request. Please try again.