From: Sean Middleditch Date: 2001-05-22T20:52:37+09:00 Subject: [ruby-talk:15539] Re: Embedding Ruby - Segfaults? On Tue, May 22, 2001 at 08:15:12PM +0900, ts wrote: > >>>>> "S" == Sean Middleditch writes: > > S> but I could swear that funcall will return Qnil (from my source-reading). > > Try it :-) Ya, it worked. I feel dumb now. Thanks! > > pigeon% cat tt.c > #include > #include > > static VALUE > tt() > { > rb_raise(rb_eSecurityError, "Insecure call"); > return Qnil; > } > > int main() > { > VALUE c; > int state; > > ruby_init(); > state = 0; > c = rb_protect(tt, 0, &state); > if (state) { > c = rb_gv_get("$!"); > c = rb_funcall(c, rb_intern("to_s"), 0); > fprintf(stderr, "ERROR :%.*s\n", RSTRING(c)->len, RSTRING(c)->ptr); > } > } > pigeon% > > pigeon% tt > ERROR :Insecure call > pigeon% > > > Guy Decoux