--- ruby/ext/rast/rast.c.old	2005-06-08 19:19:15.144737696 +0900
+++ ruby/ext/rast/rast.c	2005-06-08 19:19:19.141130152 +0900
@@ -66,7 +66,7 @@
 static void
 raise_error(rast_error_t *error)
 {
-    VALUE error_class;
+    volatile VALUE error_class;
     char buf[RAST_BUFSIZ];
 
     switch (error->type) {
@@ -132,7 +132,7 @@
 static VALUE
 pool_new()
 {
-    VALUE obj;
+    volatile VALUE obj;
 
     obj = pool_alloc(cPool);
     pool_initialize(obj);
@@ -154,7 +154,7 @@
 static char *
 hash_get_string(apr_pool_t *pool, VALUE hash, const char *name)
 {
-    VALUE val;
+    volatile VALUE val;
 
     val = rb_hash_aref(hash, rb_str_new2(name));
     SafeStringValue(val);
@@ -164,7 +164,7 @@
 static int
 hash_get_bool(VALUE hash, const char *name)
 {
-    VALUE val;
+    volatile VALUE val;
 
     val = rb_hash_aref(hash, rb_str_new2(name));
     return RTEST(val);
@@ -173,7 +173,7 @@
 static rast_type_e
 hash_get_property_type(VALUE hash, const char *name)
 {
-    VALUE val;
+    volatile VALUE val;
 
 
     val = rb_hash_aref(hash, rb_str_new2(name));
@@ -183,7 +183,7 @@
 static void
 get_bool_option(VALUE options, const char *name, int *dst)
 {
-    VALUE value = rb_hash_aref(options, rb_str_new2(name));
+    volatile VALUE value = rb_hash_aref(options, rb_str_new2(name));
     if (!NIL_P(value)) {
         *dst = RTEST(value);
     }
@@ -192,7 +192,7 @@
 static void
 get_int_option(VALUE options, const char *name, int *dst)
 {
-    VALUE value = rb_hash_aref(options, rb_str_new2(name));
+    volatile VALUE value = rb_hash_aref(options, rb_str_new2(name));
     if (RTEST(value)) {
         *dst = NUM2INT(value);
     }
@@ -201,7 +201,7 @@
 static void
 get_string_option(VALUE options, const char *name, const char **dst)
 {
-    VALUE value = rb_hash_aref(options, rb_str_new2(name));
+    volatile VALUE value = rb_hash_aref(options, rb_str_new2(name));
     if (RTEST(value)) {
         SafeStringValue(value);
         *dst = RSTRING(value)->ptr;
@@ -219,7 +219,7 @@
                                                 sizeof(rast_property_t) *
                                                 RARRAY(vproperties)->len);
     for (i = 0; i < RARRAY(vproperties)->len; i++) {
-        VALUE vproperty = RARRAY(vproperties)->ptr[i];
+        volatile VALUE vproperty = RARRAY(vproperties)->ptr[i];
         rast_property_t *property = properties + i;
 
         Check_Type(vproperty, T_HASH);
@@ -252,9 +252,9 @@
                                             rast_db_create_option_t *options,
                                             apr_pool_t *pool))
 {
-    VALUE vpool;
+    volatile VALUE vpool;
     apr_pool_t *pool;
-    VALUE properties;
+    volatile VALUE properties;
     rast_error_t *error;
     char *name;
     rast_db_create_option_t *options;
@@ -316,7 +316,7 @@
                                             rast_db_open_option_t *options,
                                             apr_pool_t *pool))
 {
-    VALUE name, vflags, voptions, vpool;
+    volatile VALUE name, vflags, voptions, vpool;
     rast_error_t *error;
     apr_pool_t *pool, *tmp_pool;
     db_data_t *data;
@@ -405,7 +405,7 @@
 static VALUE
 db_s_open(int argc, VALUE *argv, VALUE self)
 {
-    VALUE db = rb_class_new_instance(argc, argv, self);
+    volatile VALUE db = rb_class_new_instance(argc, argv, self);
     if (rb_block_given_p()) {
         return rb_ensure(rb_yield, db, db_close, db);
     }
@@ -446,7 +446,7 @@
 {
     rast_db_t *db;
     const rast_property_t *properties;
-    VALUE result;
+    volatile VALUE result;
     int i, num_properties;
 
     db = get_db(self);
@@ -454,8 +454,8 @@
     result = rb_ary_new();
     for (i = 0; i < num_properties; i++) {
         const rast_property_t *property = properties + i;
-        VALUE val, search, text_search, full_text_search, unique;
-        VALUE omit_property;
+        volatile VALUE val, search, text_search, full_text_search, unique;
+        volatile VALUE omit_property;
 
         search = property->flags & RAST_PROPERTY_FLAG_SEARCH ? Qtrue : Qfalse;
         text_search =
@@ -501,7 +501,7 @@
         apr_palloc(pool, sizeof(rast_value_t) * num_properties);
     for (i = 0; i < num_properties; i++) {
         const rast_property_t *property = properties + i;
-        VALUE value;
+        volatile VALUE value;
 
         value = rb_hash_aref(vproperty_values, rb_str_new2(property->name));
         switch (property->type) {
@@ -528,7 +528,7 @@
     rast_value_t *property_values;
     rast_error_t *error;
     apr_pool_t *pool;
-    VALUE vpool = pool_new();
+    volatile VALUE vpool = pool_new();
     rast_doc_id_t doc_id;
 
     pool = get_pool(vpool);
@@ -546,7 +546,7 @@
 static VALUE
 result_new(rast_result_t *result, int num_properties)
 {
-    VALUE terms, term, items, vitem, properties;
+    volatile VALUE terms, term, items, vitem, properties;
     int i, j;
 
     terms = rb_ary_new();
@@ -607,20 +607,20 @@
 static VALUE
 db_search(int argc, VALUE *argv, VALUE self)
 {
-    VALUE query, voptions, properties;
+    volatile VALUE query, voptions, properties;
     rast_db_t *db;
     rast_error_t *error;
     rast_search_option_t *options;
     rast_result_t *result;
     int i;
     apr_pool_t *pool;
-    VALUE vpool = pool_new(), value;
+    volatile VALUE vpool = pool_new(), value;
 
     pool = get_pool(vpool);
     db = get_db(self);
     options = rast_search_option_create(pool);
     if (rb_scan_args(argc, argv, "11", &query, &voptions) == 2) {
-        VALUE terms;
+        volatile VALUE terms;
 
         Check_Type(voptions, T_HASH);
 
@@ -693,7 +693,7 @@
     rast_value_t *property_values;
     rast_error_t *error;
     apr_pool_t *pool;
-    VALUE vpool = pool_new();
+    volatile VALUE vpool = pool_new();
 
     doc_id = (rast_doc_id_t) NUM2INT(vdoc_id);
     pool = get_pool(vpool);
@@ -714,7 +714,7 @@
     rast_db_t *db;
     rast_error_t *error;
     apr_pool_t *pool;
-    VALUE vpool = pool_new();
+    volatile VALUE vpool = pool_new();
     char *s;
     rast_size_t len;
 
@@ -730,7 +730,7 @@
 static VALUE
 merger_initialize(int argc, VALUE *argv, VALUE self)
 {
-    VALUE vdbs;
+    volatile VALUE vdbs;
     rast_error_t *error;
     apr_pool_t *pool;
     db_data_t *data;
@@ -767,7 +767,7 @@
 void
 Init_rast()
 {
-    VALUE mRast, cDB, cLocalDB, cMerger;
+    volatile VALUE mRast, cDB, cLocalDB, cMerger;
 
     apr_initialize();
     atexit(apr_terminate);
