summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-19 08:04:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-19 08:04:52 +0000
commit8053b7f3b10d686dd5296f1f5093b635bef652a6 (patch)
treef8db2f445a65ee69d9fca2a5e4ceb5492112555c /eval.c
parentec4e83ed5623edf8602dce45358c34d245314906 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 6 insertions, 2 deletions
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;