summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTomasz Dąbrowski <[email protected]>2016-11-21 12:04:49 +0100
committerTomasz Dąbrowski <[email protected]>2016-11-21 12:37:45 +0100
commitb21b02465e6643879394b41494a3462079347a92 (patch)
treeb9186e302f210de3177f22b48a0c678e31f41293 /include
parentc385782cfef484ca9cb07b128d325cfb712de69c (diff)
downloadmruby-b21b02465e6643879394b41494a3462079347a92.tar.gz
mruby-b21b02465e6643879394b41494a3462079347a92.zip
asserts checking validity of pointer and TT added for mrb_obj_value
Useful for testing when using boxing on different platforms.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/value.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/mruby/value.h b/include/mruby/value.h
index 6b29ab273..61110e3dd 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -211,6 +211,8 @@ mrb_obj_value(void *p)
{
mrb_value v;
SET_OBJ_VALUE(v, (struct RBasic*)p);
+ mrb_assert(p == mrb_ptr(v));
+ mrb_assert(((struct RBasic*)p)->tt == mrb_type(v));
return v;
}