Skip to content

Commit f8b5ada

Browse files
committed
Declare polyglot type for RSTRING_PTR.
1 parent b3b30eb commit f8b5ada

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Bug fixes:
2727
* Keep the Truffle working directory in sync with the native working directory.
2828
* Rename `to_native` to `polyglot_to_native` to match `polyglot_pointer?` and `polyglot_address` methods.
2929
* Fixed missing partial evaluation boundary in `Array#{sort,sort!}` (#1727).
30+
* Fixed missing polyglot type declaration for `RSTRING_PTR` to help with native/managed interop.
3031

3132
Compatibility:
3233

src/main/c/cext/ruby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ double rb_float_value(VALUE value) {
804804
// String
805805

806806
char *RSTRING_PTR_IMPL(VALUE string) {
807-
return RUBY_CEXT_INVOKE_NO_WRAP("RSTRING_PTR", string);
807+
return (char *)polyglot_as_i8_array(RUBY_CEXT_INVOKE_NO_WRAP("RSTRING_PTR", string));
808808
}
809809

810810
char *RSTRING_END(VALUE string) {

0 commit comments

Comments
 (0)