summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorCorey Powell <[email protected]>2015-07-11 08:25:43 -0500
committerBlaž Hrastnik <[email protected]>2015-07-13 14:04:42 +0200
commit40f48034d512a8e4f24f8d67373f18093e96513c (patch)
treeec4c3b30b77d4f8ca95239fe6083f7f37031fd7e /src
parentce6672717706365929b1c2c3c2c278e75a3c4be4 (diff)
downloadmruby-40f48034d512a8e4f24f8d67373f18093e96513c.tar.gz
mruby-40f48034d512a8e4f24f8d67373f18093e96513c.zip
Added changed check to the mrb_include_module
Diffstat (limited to 'src')
-rw-r--r--src/class.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/class.c b/src/class.c
index e9df1dae4..4a64e5b23 100644
--- a/src/class.c
+++ b/src/class.c
@@ -834,7 +834,10 @@ include_module_at(mrb_state *mrb, struct RClass *klass, struct RClass *c, struct
MRB_API void
mrb_include_module(mrb_state *mrb, struct RClass *c, struct RClass *m)
{
- include_module_at(mrb, c, c->origin, m, 1);
+ int changed = include_module_at(mrb, c, c->origin, m, 1);
+ if (changed < 0) {
+ mrb_raise(mrb, E_ARGUMENT_ERROR, "cyclic include detected");
+ }
}
MRB_API void