Skip to content

Commit e5a2cc7

Browse files
committed
[GR-16028] Use String#[] instead of Symbol#[] in Truffle::POSIX.
PullRequest: truffleruby/858
2 parents 1f445a1 + 70c7144 commit e5a2cc7

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
@@ -13,6 +13,7 @@ Bug fixes:
1313
* Convert to intuitive Ruby exceptions when INVOKE fails (#1690).
1414
* Implemented `FFI::Pointer#clear` (#1687).
1515
* Procs will now yield to the block in their declaration context even when called with a block argument (#1657).
16+
* Fixed problems with calling POSIX methods if `Symbol#[]` is redefined (#1665).
1617

1718
Compatibility
1819

src/main/ruby/core/posix.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def self.attach_function_eagerly(native_name, argument_types, return_type,
118118

119119
nfi_return_type = to_nfi_type(return_type)
120120
if nfi_return_type.to_s.start_with?('uint')
121-
unsigned_return_type = 1 << nfi_return_type[-2..-1].to_i
121+
unsigned_return_type = 1 << nfi_return_type.to_s[-2..-1].to_i
122122
end
123123

124124
bound_func = func.bind("(#{nfi_args_types.join(',')}):#{nfi_return_type}")

0 commit comments

Comments
 (0)