diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-06 10:06:07 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-06 10:06:07 +0000 |
commit | 4a80c0540f0f9b3303919ee7209eedfac856a1af (patch) | |
tree | 2d03fbd41254dafe0aa14aace9deec02303a0bf5 /string.c | |
parent | dbd90b2dff8a45969923073122dd54aede5a74ee (diff) | |
download | ruby-4a80c0540f0f9b3303919ee7209eedfac856a1af.tar.gz |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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)); } |