1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval.c (ruby_run_node): if an exception occurred in ruby_option,

the result is not executable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-10-12 10:48:35 +00:00
parent bd2a1db5af
commit 511e757cd8
2 changed files with 24 additions and 9 deletions

View file

@ -1,3 +1,8 @@
Mon Oct 12 19:48:33 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (ruby_run_node): if an exception occurred in ruby_option,
the result is not executable.
Mon Oct 12 05:51:11 2009 NARUSE, Yui <naruse@ruby-lang.org> Mon Oct 12 05:51:11 2009 NARUSE, Yui <naruse@ruby-lang.org>
* regparse.c (fetch_token): warn invalid back reference * regparse.c (fetch_token): warn invalid back reference

28
eval.c
View file

@ -215,24 +215,34 @@ ruby_stop(int ex)
exit(ruby_cleanup(ex)); exit(ruby_cleanup(ex));
} }
int
ruby_executable_node(void *n, int *status)
{
VALUE v = (VALUE)n;
int s;
switch (v) {
case Qtrue: s = EXIT_SUCCESS; break;
case Qfalse: s = EXIT_FAILURE; break;
default:
if (!FIXNUM_P(v)) return TRUE;
s = FIX2INT(v);
}
if (status) *status = s;
return FALSE;
}
int int
ruby_run_node(void *n) ruby_run_node(void *n)
{ {
int status;
if (!ruby_executable_node(n, &status)) return status;
return ruby_cleanup(ruby_exec_node(n)); return ruby_cleanup(ruby_exec_node(n));
} }
int int
ruby_exec_node(void *n) ruby_exec_node(void *n)
{ {
VALUE v = (VALUE)n;
switch (v) {
case Qtrue: return EXIT_SUCCESS;
case Qfalse: return EXIT_FAILURE;
}
if (FIXNUM_P(v)) {
return FIX2INT(v);
}
ruby_init_stack((void *)&n); ruby_init_stack((void *)&n);
return ruby_exec_internal(n); return ruby_exec_internal(n);
} }