aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/ruby18/files/patch-eval.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/lang/ruby18/files/patch-eval.c b/lang/ruby18/files/patch-eval.c
index 9c0f6694b835..72fc25e22608 100644
--- a/lang/ruby18/files/patch-eval.c
+++ b/lang/ruby18/files/patch-eval.c
@@ -1,8 +1,8 @@
Index: eval.c
diff -u -p eval.c.orig eval.c
--- eval.c.orig Tue Dec 20 22:41:47 2005
-+++ eval.c Sun Jan 22 02:50:12 2006
-@@ -129,20 +129,44 @@ rb_jump_context(env, val)
++++ eval.c Sun Jan 22 13:59:48 2006
+@@ -129,32 +129,64 @@ rb_jump_context(env, val)
* But it has not the problem because gcc knows setjmp may return twice.
* gcc detects setjmp and generates setjmp safe code.
*
@@ -34,42 +34,39 @@ diff -u -p eval.c.orig eval.c
+ * http://lists.freebsd.org/pipermail/freebsd-sparc64/2006-January/003739.html
*/
-#if defined (__GNUC__) && (defined(sparc) || defined(__sparc__))
-+#define FUNCTION_CALL_MAY_RETURN_TWICE \
-+ ({ __asm__ volatile ("" : : : \
-+ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
-+ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \
-+ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
-+#else
#define FUNCTION_CALL_MAY_RETURN_TWICE \
({ __asm__ volatile ("" : : : \
"%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
- "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
+- "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
++ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", \
"%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
-+#endif
#else
++#define FUNCTION_CALL_MAY_RETURN_TWICE \
++ ({ __asm__ volatile ("" : : : \
++ "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", \
++ "%l0", "%l1", "%l2", "%l3", "%l4", "%l5", "%l6", "%l7", \
++ "%i0", "%i1", "%i2", "%i3", "%i4", "%i5", "%i7"); })
++#endif
++#elif defined(__ia64)
static jmp_buf function_call_may_return_twice_jmp_buf;
int function_call_may_return_twice_false = 0;
-@@ -151,11 +175,23 @@ int function_call_may_return_twice_false
+ #define FUNCTION_CALL_MAY_RETURN_TWICE \
+ (function_call_may_return_twice_false ? \
setjmp(function_call_may_return_twice_jmp_buf) : \
0)
- #endif
+#else
+#define FUNCTION_CALL_MAY_RETURN_TWICE 0
+#endif
- #define ruby_longjmp(env, val) rb_jump_context(env, val)
-+#if GCC_VERSION_BEFORE(4,0,3) && \
-+ (defined(sparc) || defined(__sparc__) || defined(__ia64))
-+#define ruby_setjmp(j) ((j)->status = 0, \
-+ FUNCTION_CALL_MAY_RETURN_TWICE, \
-+ getcontext(&(j)->context), \
-+ FUNCTION_CALL_MAY_RETURN_TWICE, \
-+ (j)->status)
+#else
++#define FUNCTION_CALL_MAY_RETURN_TWICE 0
+ #endif
+ #define ruby_longjmp(env, val) rb_jump_context(env, val)
++static volatile int freebsd_clear_carry_flag = 0;
#define ruby_setjmp(j) ((j)->status = 0, \
FUNCTION_CALL_MAY_RETURN_TWICE, \
++ freebsd_clear_carry_flag = freebsd_clear_carry_flag + freebsd_clear_carry_flag, \
getcontext(&(j)->context), \
++ FUNCTION_CALL_MAY_RETURN_TWICE, \
(j)->status)
-+#endif
#else
typedef jmp_buf rb_jmpbuf_t;
- #if !defined(setjmp) && defined(HAVE__SETJMP)