From 8053b7f3b10d686dd5296f1f5093b635bef652a6 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 19 Jul 2000 08:04:52 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 24a7298387..b9043f3502 100644 --- a/eval.c +++ b/eval.c @@ -92,9 +92,9 @@ static int scope_vmode; int ruby_safe_level = 0; /* safe-level: 0 - strings from streams/environment/ARGV are tainted (default) - 1 - no dangerous operation by tainted string + 1 - no dangerous operation by tainted value 2 - process/file operations prohibited - 3 - all genetated strings are tainted + 3 - all genetated objects are tainted 4 - no global (non-tainted) variable modification/no direct output */ @@ -5223,6 +5223,10 @@ rb_mod_modfunc(argc, argv, module) ID id; NODE *body; + if (TYPE(module) != T_MODULE) { + rb_raise(rb_eTypeError, "module_function must be called for modules"); + } + if (argc == 0) { SCOPE_SET(SCOPE_MODFUNC); return module; -- cgit v1.2.3