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 = 1
24342434 return "poly_array"
24352435 end
2436+ # Proc / lambda literals as elements (`[proc { ... }, proc { ... }]`):
2437+ # each element is a heap-allocated sp_Proc pointer. Spinel has no
2438+ # typed `proc_ptr_array` slot, so box via poly_array — sp_box_proc
2439+ # is called on each push, and the poly-builtin dispatch on `arr[i]`
2440+ # recovers the proc. Without this arm, the array's inferred type
2441+ # fell back to `int_array`, and `sp_IntArray_push` was called with
2442+ # a sp_Proc pointer — int-from-pointer C-compile error.
2443+ if et == "proc" || et == "lambda"
2444+ @needs_gc = 1
2445+ @needs_rb_value = 1
2446+ return "poly_array"
2447+ end
24362448 # Check if elements have mixed types
24372449 k = 1
24382450 while k < elems.length