Skip to content

Commit da8e7cc

Browse files
committed
merge revision(s) r45503,r45504,r45508,r45509,r47275: [Backport ruby#9692]
* configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a variable as the second argument of __builtin_longjmp(). [ruby-core:61800] [Bug ruby#9692] * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp() in clang 5.1 uses `void**`, not `jmp_buf`. [Bug ruby#9692] * configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp() in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`. [Bug ruby#9692] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e552b9a commit da8e7cc

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
lines changed

ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Tue Aug 26 00:02:51 2014 Nobuyoshi Nakada <[email protected]>
2+
3+
* configure.in (ac_cv_func___builtin_setjmp): __builtin_longjmp()
4+
in Apple LLVM 5.1 (LLVM 3.4svn) uses `void**`, not `jmp_buf`.
5+
[Bug #9692]
6+
7+
Tue Aug 26 00:02:51 2014 Nobuyoshi Nakada <[email protected]>
8+
9+
* configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a
10+
variable as the second argument of __builtin_longjmp().
11+
[ruby-core:61800] [Bug #9692]
12+
113
Mon Aug 25 00:36:56 2014 Nobuyoshi Nakada <[email protected]>
214

315
* parse.y (parser_yylex): fix invalid char in eval, should raise

configure.in

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,13 +2022,25 @@ AC_CACHE_CHECK(for sigsetjmp as a macro or function, ac_cv_func_sigsetjmp,
20222022
ac_cv_func_sigsetjmp=yes,
20232023
ac_cv_func_sigsetjmp=no)])
20242024

2025+
if test x"${ac_cv_func___builtin_setjmp}" = xyes; then
2026+
unset ac_cv_func___builtin_setjmp
2027+
fi
20252028
AC_CACHE_CHECK(for __builtin_setjmp, ac_cv_func___builtin_setjmp,
2029+
[
2030+
for cast in "" "(void *)"; do
2031+
RUBY_WERROR_FLAG(
20262032
[AC_TRY_LINK([@%:@include <setjmp.h>
2027-
jmp_buf jb; void t(v) int v; {__builtin_longjmp(jb, v);}],
2028-
[__builtin_setjmp(jb);],
2029-
[ac_cv_func___builtin_setjmp=yes],
2033+
@%:@include <stdio.h>
2034+
jmp_buf jb;
2035+
void t(void) {__builtin_longjmp($cast jb, 1);}],
2036+
[
2037+
void (*volatile f)(void) = t;
2038+
if (!__builtin_setjmp($cast jb)) printf("%d\n", f != 0);
2039+
],
2040+
[ac_cv_func___builtin_setjmp="yes with cast ($cast)"; break],
20302041
[ac_cv_func___builtin_setjmp=no])
20312042
])
2043+
done])
20322044

20332045
# we don't use _setjmp if _longjmp doesn't exist.
20342046
test x$ac_cv_func__longjmp = xno && ac_cv_func__setjmp=no
@@ -2046,11 +2058,13 @@ AC_ARG_WITH(setjmp-type,
20462058
[setjmpex], [ setjmp_prefix= setjmp_suffix=ex],
20472059
[''], [ unset setjmp_prefix],
20482060
[ AC_MSG_ERROR(invalid setjmp type: $withval)])], [unset setjmp_prefix])
2061+
setjmp_cast=
20492062
if test ${setjmp_prefix+set}; then
20502063
if test "${setjmp_prefix}" && eval test '$ac_cv_func_'${setjmp_prefix}setjmp${setjmp_suffix} = no; then
20512064
AC_MSG_ERROR(${setjmp_prefix}setjmp${setjmp_suffix} is not available)
20522065
fi
2053-
elif test "$ac_cv_func___builtin_setjmp" = yes; then
2066+
elif { AS_CASE("$ac_cv_func___builtin_setjmp", [yes*], [true], [false]); }; then
2067+
setjmp_cast=`expr "$ac_cv_func___builtin_setjmp" : "yes with cast (\(.*\))"`
20542068
setjmp_prefix=__builtin_
20552069
setjmp_suffix=
20562070
elif test "$ac_cv_header_setjmpex_h:$ac_cv_func__setjmpex" = yes:yes; then
@@ -2071,9 +2085,9 @@ if test x$setjmp_prefix = xsig; then
20712085
else
20722086
unset setjmp_sigmask
20732087
fi
2074-
AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix})
2075-
AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}(env${setjmp_sigmask+,0})])
2076-
AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp(env,val)])
2088+
AC_MSG_RESULT(${setjmp_prefix}setjmp${setjmp_suffix}${setjmp_cast:+($setjmp_cast)})
2089+
AC_DEFINE_UNQUOTED([RUBY_SETJMP(env)], [${setjmp_prefix}setjmp${setjmp_suffix}($setjmp_cast(env)${setjmp_sigmask+,0})])
2090+
AC_DEFINE_UNQUOTED([RUBY_LONGJMP(env,val)], [${setjmp_prefix}longjmp($setjmp_cast(env),val)])
20772091
AC_DEFINE_UNQUOTED(RUBY_JMP_BUF, ${setjmp_sigmask+${setjmp_prefix}}jmp_buf)
20782092
# End of setjmp check.
20792093

eval_intern.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ NORETURN(static inline void rb_threadptr_tag_jump(rb_thread_t *, int));
154154
static inline void
155155
rb_threadptr_tag_jump(rb_thread_t *th, int st)
156156
{
157-
ruby_longjmp(th->tag->buf, (th->state = st));
157+
th->state = st;
158+
ruby_longjmp(th->tag->buf, 1);
158159
}
159160

160161
/*

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#define RUBY_VERSION "2.1.2"
2-
#define RUBY_RELEASE_DATE "2014-08-25"
3-
#define RUBY_PATCHLEVEL 209
2+
#define RUBY_RELEASE_DATE "2014-08-26"
3+
#define RUBY_PATCHLEVEL 210
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 8
7-
#define RUBY_RELEASE_DAY 25
7+
#define RUBY_RELEASE_DAY 26
88

99
#include "ruby/version.h"
1010

0 commit comments

Comments
 (0)