summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-14 03:03:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-14 03:03:52 +0000
commit207c58b518c31e6f54c0e4acab8dad76c3dda8c7 (patch)
tree2ca92183b185f8fe4962d88a1c6bc6cd5f036427 /eval.c
parent073297789aac2e4e4208d2bd228627a86c9f9460 (diff)
eval.c: set nil if nothing done
* 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
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 139c320733..cc16e393e8 100644
--- a/eval.c
+++ b/eval.c
@@ -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) {