Skip to content

Commit edb6972

Browse files
aardvark179eregon
authored andcommitted
Fix rb_hash_foreach to accept ST_CHECK from function.
1 parent 8814d48 commit edb6972

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/truffle/truffle/cext.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,13 +965,16 @@ def rb_hash_set_ifnone(hash, value)
965965
ST_CONTINUE = 0
966966
ST_STOP = 1
967967
ST_DELETE = 2
968+
ST_CHECK = 3
969+
ST_REPLACE = 4
968970

969971
def rb_hash_foreach(hash, func, farg)
970972
hash.each do |key, value|
971973
st_result = Truffle::Interop.execute_without_conversion(func, Primitive.cext_wrap(key), Primitive.cext_wrap(value), farg)
972974

973975
case st_result
974976
when ST_CONTINUE
977+
when ST_CHECK
975978
when ST_STOP then break
976979
when ST_DELETE then hash.delete(key)
977980
else raise ArgumentError, "Unknown 'func' return value: #{st_result}"

0 commit comments

Comments
 (0)