Skip to content

Commit

Permalink
eval.c: set nil if nothing done
Browse files Browse the repository at this point in the history
* eval.c (ruby_eval_main_internal): set nil to the result if nothing
  executed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jun 14, 2012
1 parent 0732977 commit 207c58b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ ruby_eval_main_internal(VALUE iseqval, VALUE* result)
volatile VALUE retval;
rb_thread_t *th = GET_THREAD();

if (!iseqval) return 0;
if (!iseqval) {
*result = Qnil;
return 0;
}

PUSH_TAG();
if ((state = EXEC_TAG()) == 0) {
Expand Down

0 comments on commit 207c58b

Please sign in to comment.