Commit 3dc5bee4
3dc5bee4e5daMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 12 files · +10 added · ~2 modified
Description
Merge pull request #458 from ryanseys/rs-no-recv-io-expr-bridge
fix(analyze,codegen): bridge no-recv IO; poly_array of procs; poly .call
Rebased onto master to resolve conflict with the poly-recv .dup arm (4b5aadb) that lived at the same emit_poly_builtin_dispatch site; the two arms (.call and .dup) coexist side-by-side after the resolution.
Details
- Commit
- 3dc5bee4e5da
- Parent
- b90c30c3b0d9
- Merge parent
- 61a12a452f0d
spinel_analyze.rbmodifiedView file
@@ -2433,6 +2433,18 @@
24332433
@needs_rb_value = 124342434
return "poly_array"24352435
end2436+
# Proc / lambda literals as elements (`[proc { ... }, proc { ... }]`):2437+
# each element is a heap-allocated sp_Proc pointer. Spinel has no2438+
# typed `proc_ptr_array` slot, so box via poly_array — sp_box_proc2439+
# is called on each push, and the poly-builtin dispatch on `arr[i]`2440+
# recovers the proc. Without this arm, the array's inferred type2441+
# fell back to `int_array`, and `sp_IntArray_push` was called with2442+
# a sp_Proc pointer — int-from-pointer C-compile error.2443+
if et == "proc" || et == "lambda"2444+
@needs_gc = 12445+
@needs_rb_value = 12446+
return "poly_array"2447+
end24362448
# Check if elements have mixed types24372449
k = 124382450
while k < elems.lengthspinel_codegen.rbmodifiedView file
Loading diff…
test/case_when_qualified_class.rbaddedView file
Loading diff…
test/case_when_qualified_class.rb.expectedaddedView file
Loading diff…
test/if_expr_multi_stmt_body.rbaddedView file
Loading diff…
test/if_expr_multi_stmt_body.rb.expectedaddedView file
Loading diff…
test/introspection_constant_path.rbaddedView file
Loading diff…
test/introspection_constant_path.rb.expectedaddedView file
Loading diff…
test/io_call_in_proc_body.rbaddedView file
Loading diff…
test/io_call_in_proc_body.rb.expectedaddedView file
Loading diff…
test/proc_anon_dot_call.rbaddedView file
Loading diff…
test/proc_anon_dot_call.rb.expectedaddedView file
Loading diff…