зеркало из https://github.com/github/ruby.git
* eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): activate only
before gcc 4.0.3 on SPARC and IA64. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
f511d52438
Коммит
dba8153266
|
@ -1,3 +1,8 @@
|
|||
Mon Dec 19 12:20:59 2005 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* eval.c (FUNCTION_CALL_MAY_RETURN_TWICE): activate only
|
||||
before gcc 4.0.3 on SPARC and IA64.
|
||||
|
||||
Mon Dec 19 11:37:47 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||
|
||||
* ext/syck/rubyext.c: sorry, I reverted my "should set newly
|
||||
|
|
18
eval.c
18
eval.c
|
@ -126,7 +126,18 @@ rb_jump_context(env, val)
|
|||
*
|
||||
* Since the magic setjmp is not enough for SPARC,
|
||||
* inline asm is used to prohibit registers in register windows.
|
||||
*
|
||||
* Since the problem is fixed at gcc 4.0.3, the magic is applied only for
|
||||
* prior versions of gcc.
|
||||
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21957
|
||||
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22127
|
||||
*/
|
||||
#define GCC_VERSION_BEFORE(major, minor, patchlevel) \
|
||||
(defined (__GNUC__) && \
|
||||
((__GNUC__ < (major)) || \
|
||||
(__GNUC__ == (major) && __GNUC_MINOR__ < (minor)) || \
|
||||
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ < (patchlevel))))
|
||||
#if GCC_VERSION_BEFORE(4,0,3)
|
||||
#if defined (__GNUC__) && (defined(sparc) || defined(__sparc__))
|
||||
#define FUNCTION_CALL_MAY_RETURN_TWICE \
|
||||
({ __asm__ volatile ("" : : : \
|
||||
|
@ -134,12 +145,19 @@ rb_jump_context(env, val)
|
|||
"%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
|
||||
"%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
|
||||
#else
|
||||
#if defined(__ia64__)
|
||||
static jmp_buf function_call_may_return_twice_jmp_buf;
|
||||
int function_call_may_return_twice_false = 0;
|
||||
#define FUNCTION_CALL_MAY_RETURN_TWICE \
|
||||
(function_call_may_return_twice_false ? \
|
||||
setjmp(function_call_may_return_twice_jmp_buf) : \
|
||||
0)
|
||||
#else
|
||||
#define FUNCTION_CALL_MAY_RETURN_TWICE 0
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define FUNCTION_CALL_MAY_RETURN_TWICE 0
|
||||
#endif
|
||||
#define ruby_longjmp(env, val) rb_jump_context(env, val)
|
||||
#define ruby_setjmp(j) ((j)->status = 0, \
|
||||
|
|
Загрузка…
Ссылка в новой задаче