summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 2a174a1868..2ed291d0c6 100644
--- a/eval.c
+++ b/eval.c
@@ -3958,11 +3958,11 @@ f_eval(argc, argv, self)
int line = 0;
rb_scan_args(argc, argv, "13", &src, &scope, &vfile, &vline);
- if (!NIL_P(vfile)) {
+ if (argc >= 3) {
Check_Type(vfile, T_STRING);
file = RSTRING(vfile)->ptr;
}
- if (!NIL_P(vline)) {
+ if (argc >= 4) {
line = NUM2INT(vline);
}