Skip to content

Commit e4d5dfa

Browse files
committed
[GR-19473] Declare polyglot type for RSTRING_PTR.
PullRequest: truffleruby/1160
2 parents f054b32 + f8b5ada commit e4d5dfa

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
@@ -28,6 +28,7 @@ Bug fixes:
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).
3030
* Fixed the class of `self` and the wrapping `Module` for `Kernel#load(path, wrap=true)` (#1739).
31+
* Fixed missing polyglot type declaration for `RSTRING_PTR` to help with native/managed interop.
3132

3233
Compatibility:
3334

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)