From 274be4bf17f53dbb3fd4606416c390136ae38c34 Mon Sep 17 00:00:00 2001 From: Alexey I. Froloff Date: Fri, 8 May 2009 15:49:49 +0400 Subject: [PATCH] Fix compilation with gcc-4.4 and -D_FORTIFY_SOURCE=2. When compiling ruby 1.9 with recent gcc bug in catch/throw handling may occur: ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc /usr/src/RPM/BUILD/ruby-1.9.1-alt0.20090504/lib/optparse.rb:1310: [BUG] Segmentation fault ruby 1.9.1p0 (2009-05-04) [i586-linux-gnu] In rb_f_catch() mark val as volatile. Signed-off-by: Kirill A. Shutemov Signed-off-by: Alexey I. Froloff --- vm_eval.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vm_eval.c b/vm_eval.c index aaef1c7..0ec8478 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -1232,7 +1232,7 @@ rb_f_catch(int argc, VALUE *argv) { VALUE tag; int state; - VALUE val = Qnil; /* OK */ + volatile VALUE val = Qnil; /* OK */ rb_thread_t *th = GET_THREAD(); rb_control_frame_t *saved_cfp = th->cfp; -- 1.6.2.4