summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 10:06:07 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 10:06:07 +0000
commit4a80c0540f0f9b3303919ee7209eedfac856a1af (patch)
tree2d03fbd41254dafe0aa14aace9deec02303a0bf5 /string.c
parentdbd90b2dff8a45969923073122dd54aede5a74ee (diff)
adopt sanitizer API
These APIs are much like <valgrind/memcheck.h>. Use them to fine-grain annotate the usage of our memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/string.c b/string.c
index 2ff709b0b2..42f9b53148 100644
--- a/string.c
+++ b/string.c
@@ -803,6 +803,11 @@ VALUE
rb_str_new_cstr(const char *ptr)
{
must_not_null(ptr);
+ /* rb_str_new_cstr() can take pointer from non-malloc-generated
+ * memory regions, and that cannot be detected by the MSAN. Just
+ * trust the programmer that the argument passed here is a sane C
+ * string. */
+ __msan_unpoison_string(ptr);
return rb_str_new(ptr, strlen(ptr));
}