about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-04-21 16:29:56 -0700
committerEric Wong <normalperson@yhbt.net>2010-04-21 16:29:56 -0700
commite142f2c5db4427be70d10d7e1316e139d08a7c3e (patch)
tree911deab5c0939d29185cd120e8a2790527066c4c /ext
parenta0ee3ba2d08acb423a1cbc4a5ae862bd40c4b914 (diff)
downloadclogger-e142f2c5db4427be70d10d7e1316e139d08a7c3e.tar.gz
The return value of rb_inspect() may not be visible
on the stack without assigning it to a local variable
first.
Diffstat (limited to 'ext')
-rw-r--r--ext/clogger_ext/clogger.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index 453ff48..8d3bce8 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -709,12 +709,14 @@ static VALUE ccall(struct clogger *c, VALUE env)
                         rb_ary_store(rv, 1, c->headers);
                 }
         } else {
+                volatile VALUE tmp = rb_inspect(rv);
+
                 c->status = INT2FIX(500);
                 c->headers = c->body = rb_ary_new();
                 cwrite(c);
                 rb_raise(rb_eTypeError,
                          "app response not a 3 element Array: %s",
-                         RSTRING_PTR(rb_inspect(rv)));
+                         RSTRING_PTR(tmp));
         }
 
         return rv;