Commit 000fe5e5
000fe5e5ce2aMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 3 files · +2 added · ~1 modified
Description
Merge pull request #317 from mame/pr/poly-array-push-handlers
fix(codegen): poly_array << / push handlers in both expr and stmt context
Details
- Commit
- 000fe5e5ce2a
- Parent
- 42c00eb066d0
- Merge parent
- 8ad869e58a58
spinel_codegen.rbmodifiedView file
@@ -22044,6 +22044,12 @@
2204422044
rc = compile_expr_gc_rooted(recv)2204522045
return "(sp_PtrArray_push(" + rc + ", " + compile_arg0(nid) + "), " + rc + ")"2204622046
end22047+
if lt == "poly_array"22048+
@needs_rb_value = 122049+
@needs_gc = 122050+
rc = compile_expr_gc_rooted(recv)22051+
return "(sp_PolyArray_push(" + rc + ", " + box_expr_to_poly(get_args(@nd_arguments[nid])[0]) + "), " + rc + ")"22052+
end2204722053
if lt == "poly"2204822054
@needs_rb_value = 12204922055
return "sp_poly_shl(" + compile_expr(recv) + ", " + box_expr_to_poly(get_args(@nd_arguments[nid])[0]) + ")"@@ -29310,6 +29316,22 @@
2931029316
emit(" sp_PtrArray_push(" + rc + ", " + compile_arg0(nid) + ");")2931129317
return 12931229318
end29319+
if rt == "poly_array"29320+
rc = compile_expr_gc_rooted(recv)29321+
args_id3 = @nd_arguments[nid]29322+
if args_id3 >= 029323+
aa = get_args(args_id3)29324+
if aa.length > 029325+
vt = infer_type(aa[0])29326+
vexpr = compile_expr(aa[0])29327+
if vt != "poly"29328+
vexpr = box_value_to_poly(vt, vexpr)29329+
end29330+
emit(" sp_PolyArray_push(" + rc + ", " + vexpr + ");")29331+
return 129332+
end29333+
end29334+
end2931329335
end2931429336
end2931529337
test/poly_array_push_handlers.rbaddedView file
Loading diff…
test/poly_array_push_handlers.rb.expectedaddedView file
Loading diff…