File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ Bug fixes:
32
32
* Fixed ` Module#to_s ` and ` Module#inspect ` to not return an extra ` #<Class: ` for singleton classes.
33
33
* Arrays backed by native storage now allocate the correct amount of memory (#1828 ).
34
34
* Fixed issue in ` ConditionVariable#wait ` that could lose a ` ConditionVariable#signal ` .
35
+ * Do not leak TruffleRuby specific method Array#swap (#1816 )
35
36
36
37
Compatibility:
37
38
Original file line number Diff line number Diff line change @@ -1105,7 +1105,7 @@ def sample_many(count, rng)
1105
1105
result = Array . new ( self )
1106
1106
1107
1107
count . times do |c |
1108
- result . swap c , rng . rand ( size )
1108
+ Truffle . privately { result . swap c , rng . rand ( size ) }
1109
1109
end
1110
1110
1111
1111
count == size ? result : result [ 0 , count ]
@@ -1670,10 +1670,11 @@ def sort!(&block)
1670
1670
TrufflePrimitive . steal_array_storage ( self , sort ( &block ) )
1671
1671
end
1672
1672
1673
+ private
1674
+
1673
1675
def swap ( a , b )
1674
1676
temp = at ( a )
1675
1677
self [ a ] = at ( b )
1676
1678
self [ b ] = temp
1677
1679
end
1678
- protected :swap
1679
1680
end
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def self.object_keys(object, internal)
48
48
# FIXME (pitr-ch 11-May-2019): remove the branch
49
49
keys = [ ]
50
50
else
51
+ # TODO (pitr-ch 28-Nov-2019): make sure protected methods are not listed unless internal
51
52
keys = [ ]
52
53
object . methods . each do |method |
53
54
keys << method . to_s if Truffle ::Type . object_respond_to? object , method , true
You can’t perform that action at this time.
0 commit comments