R
Rolando Abarca
I'm facing some problems about exception handling using the ruby 1.9.1-
p0 interpreter, this is how I'm initializing the interpreter:
RUBY_INIT_STACK;
ruby_init();
and then, I load the main ruby script:
int state;
rb_protect((VALUE (*)())_ShinyCocosRequire,
rb_str_new2(script_location), &state);
_ShinyCocosRequire is defined like this:
VALUE _ShinyCocosRequire(VALUE path) {
//rb_require_safe(path, rb_safe_level());
rb_require(STR2CSTR(path));
return Qnil;
}
Everything works just fine if there's no exception raised in the code.
If an exception is raised, I get a BAD_ACCESS error, on vm.c, line 743:
ary = vm_backtrace_each(th, RUBY_VM_NEXT_CONTROL_FRAME(cfp),
top_of_cfp, RSTRING_PTR(th->vm->progname), 0, ary);
The backtrace (in the test case) is because of a method missing not
being handled... What's the way to go with ruby1.9 and exception
handling when embedding the interpreter?
I've searched the net, but so far I've only found articles about
embedding ruby 1.8 and not 1.9...
thanks for any tip!
p0 interpreter, this is how I'm initializing the interpreter:
RUBY_INIT_STACK;
ruby_init();
and then, I load the main ruby script:
int state;
rb_protect((VALUE (*)())_ShinyCocosRequire,
rb_str_new2(script_location), &state);
_ShinyCocosRequire is defined like this:
VALUE _ShinyCocosRequire(VALUE path) {
//rb_require_safe(path, rb_safe_level());
rb_require(STR2CSTR(path));
return Qnil;
}
Everything works just fine if there's no exception raised in the code.
If an exception is raised, I get a BAD_ACCESS error, on vm.c, line 743:
ary = vm_backtrace_each(th, RUBY_VM_NEXT_CONTROL_FRAME(cfp),
top_of_cfp, RSTRING_PTR(th->vm->progname), 0, ary);
The backtrace (in the test case) is because of a method missing not
being handled... What's the way to go with ruby1.9 and exception
handling when embedding the interpreter?
I've searched the net, but so far I've only found articles about
embedding ruby 1.8 and not 1.9...
thanks for any tip!