Permalink
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...
1 parent c9e0781 commit 10afe5d96bc3d562958e905102de1db44188ac2b @rlerdorf rlerdorf committed Mar 18, 2008
Showing with 17 additions and 6 deletions.
  1. +1 −1 Zend/Zend.m4
  2. +1 −1 Zend/zend.c
  3. +13 −3 Zend/zend.h
  4. +1 −1 Zend/zend_globals.h
  5. +1 −0 win32/build/config.w32.h.in
View
@@ -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
@@ -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
@@ -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
@@ -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;
@@ -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

0 comments on commit 10afe5d

Please sign in to comment.