We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fddc14 commit 26cc873Copy full SHA for 26cc873
src/main/c/cext/ruby.c
@@ -812,7 +812,11 @@ char *rb_string_value_cstr(VALUE *value_pointer) {
812
}
813
814
char *RSTRING_PTR_IMPL(VALUE string) {
815
- return (char *)polyglot_as_i8_array(RUBY_CEXT_INVOKE_NO_WRAP("RSTRING_PTR", string));
+ if (polyglot_as_boolean(RUBY_CEXT_INVOKE_NO_WRAP("native_string?", string))) {
816
+ return NATIVE_RSTRING_PTR(string);
817
+ } else {
818
+ return (char *)polyglot_as_i8_array(RUBY_CEXT_INVOKE_NO_WRAP("RSTRING_PTR", string));
819
+ }
820
821
822
char *RSTRING_END(VALUE string) {
0 commit comments