Commit 387299c7

387299c7427bMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 2 files · ~2 modified

Description

fix(analyze,codegen): split(",", -1) / split(";", -1) preserve trailing empties (#807)

Same family of bugs as the split("|") fix in 73e52c8: when the last field in a serialized list is empty, MRI's split drops it during the bootstrap stage 1 run, so the fixpoint sees a shorter table than what was written. Spinel's runtime split keeps trailing empties already, so the bug only manifests during the MRI-driven boot.

Wholesale replacement: every .split(",") -> .split(",", -1) and every .split(";") -> .split(";", -1) across analyze + codegen. Loud diff, mechanical change -- each call site that round-trips through serialize/deserialize now preserves the trailing empty fields that signal "param without default", "method without body" etc.

Closes #807

Co-Authored-By: Claude Opus 4.7 [email protected]

Details

Commit
387299c7427b
Parent
b7bf771f317c

spinel_analyze.rbmodifiedView file

@@ -16,7 +16,7 @@
1616
1717
1818 def initialize
19- @out_lines = "".split(",")
19+ @out_lines = "".split(",", -1)
2020 @out = ""
2121 @deferred_tuple = ""
2222 @deferred_lambda = ""
@@ -30,16 +30,16 @@
3030 @cur_writer_body = -1
3131
3232 # ---- AST node storage (parallel arrays by node ID) ----
33- # Use "".split(",") for StrArray init (v1 infers StrArray from split)
34- @nd_type = "".split(",")
35- @nd_name = "".split(",")
33+ # Use "".split(",", -1) for StrArray init (v1 infers StrArray from split)
34+ @nd_type = "".split(",", -1)
35+ @nd_name = "".split(",", -1)
3636 @nd_value = []
37- @nd_content = "".split(",")
37+ @nd_content = "".split(",", -1)
3838 @nd_flags = []
39- @nd_operator = "".split(",")
40- @nd_binop = "".split(",")
41- @nd_callop = "".split(",")
42- @nd_unescaped = "".split(",")
39+ @nd_operator = "".split(",", -1)
40+ @nd_binop = "".split(",", -1)
41+ @nd_callop = "".split(",", -1)
42+ @nd_unescaped = "".split(",", -1)
4343
4444 # Node references (integer node IDs, -1 = nil)
4545 @nd_receiver = []
@@ -68,29 +68,29 @@
6868 @nd_collection = []
6969
7070 # Node array fields: stored as comma-separated ID strings
71- @nd_stmts = "".split(",")
72- @nd_args = "".split(",")
73- @nd_requireds = "".split(",")
74- @nd_optionals = "".split(",")
75- @nd_keywords = "".split(",")
76- @nd_elements = "".split(",")
77- @nd_parts = "".split(",")
78- @nd_conditions = "".split(",")
79- @nd_exceptions = "".split(",")
80- @nd_targets = "".split(",")
81- @nd_rights = "".split(",")
71+ @nd_stmts = "".split(",", -1)
72+ @nd_args = "".split(",", -1)
73+ @nd_requireds = "".split(",", -1)
74+ @nd_optionals = "".split(",", -1)
75+ @nd_keywords = "".split(",", -1)
76+ @nd_elements = "".split(",", -1)
77+ @nd_parts = "".split(",", -1)
78+ @nd_conditions = "".split(",", -1)
79+ @nd_exceptions = "".split(",", -1)
80+ @nd_targets = "".split(",", -1)
81+ @nd_rights = "".split(",", -1)
8282 # ParametersNode#posts -- required params after the splat
8383 # (def f(*r, x, y) → posts = [x, y]). Currently unused by codegen
8484 # (post-rest parameters aren't observed in test/), but the parser
8585 # emits the field so future tests get a proper AST.
86- @nd_posts = "".split(",")
86+ @nd_posts = "".split(",", -1)
8787 # AliasMethodNode / AliasGlobalVariableNode -- parallel ref slots
8888 # for the new and old names (SymbolNode for methods, GlobalVariableReadNode
8989 # for globals).
9090 @nd_new_name = []
9191 @nd_old_name = []
9292 # UndefNode -- comma-separated child ids for the SymbolNode names.
93- @nd_names = "".split(",")
93+ @nd_names = "".split(",", -1)
9494
9595 # Per-node inferred type, parallel to the other @nd_* arrays.
9696 # Empty string means "not yet annotated"; node_type falls back to
@@ -98,7 +98,7 @@
9898 # `freeze_analysis` runs, every reachable node gets a non-empty
9999 # entry so the codegen path becomes O(1) per node lookup instead
100100 # of recursively re-walking the subtree on every infer_type call.
101- @nd_inferred_type = "".split(",")
101+ @nd_inferred_type = "".split(",", -1)
102102 # Scratch state used by promote_reinfer_array_returns +
103103 # walk_reinfer_lv_writes. Self-host can't capture block params
104104 # across closures yet, so the helpers thread per-walk parameters
@@ -124,29 +124,29 @@
124124 # @nd_scope_names[bid] means "no precomputed scope decls for this
125125 # bid"; codegen falls back to its own scan_locals path in that
126126 # case (block-iteration bodies, ad-hoc temp scopes, etc.).
127- @nd_scope_names = "".split(",")
128- @nd_scope_types = "".split(",")
127+ @nd_scope_names = "".split(",", -1)
128+ @nd_scope_types = "".split(",", -1)
129129
130130 @nd_count = 0
131131 @root_id = 0
132132
133133 # Issue: unresolved-call warnings deduped by "<mname>:<recv_type>"
134134 # so a hot call site that fails to resolve emits one warning, not N.
135- @unresolved_call_warnings = "".split(",")
135+ @unresolved_call_warnings = "".split(",", -1)
136136
137137 # ---- Top-level methods (parallel arrays) ----
138- @meth_names = "".split(",")
139- @meth_param_names = "".split(",")
140- @meth_param_types = "".split(",")
138+ @meth_names = "".split(",", -1)
139+ @meth_param_names = "".split(",", -1)
140+ @meth_param_types = "".split(",", -1)
141141 # Per-param "deferred element" flag: "1" means at least one caller
142142 # passed an empty `[]` literal (or a local that itself was assigned
143143 # an empty literal). Used by the param body-push promotion pass
144144 # to decide whether the param's int_array can be safely
145145 # promoted to a concrete typed-array based on body usage.
146- @meth_param_empty = "".split(",")
147- @meth_return_types = "".split(",")
146+ @meth_param_empty = "".split(",", -1)
147+ @meth_return_types = "".split(",", -1)
148148 @meth_body_ids = []
149- @meth_has_defaults = "".split(",")
149+ @meth_has_defaults = "".split(",", -1)
150150 @meth_rest_index = []
151151 # Position of the **kwrest param in @meth_param_names (-1 if no
152152 # kwrest). Lets call-site arg-packing detect the slot that should
@@ -154,14 +154,14 @@
154154 @meth_kwrest_index = []
155155
156156 # ---- Classes (parallel arrays) ----
157- @cls_names = "".split(",")
158- @cls_parents = "".split(",")
157+ @cls_names = "".split(",", -1)
158+ @cls_parents = "".split(",", -1)
159159 # per-class list of included module
160160 # names, semicolon-separated. Modules live in @module_names so
161161 # the resolution from name -> id is deferred to codegen time.
162- @cls_includes = "".split(",")
163- @cls_ivar_names = "".split(",")
164- @cls_ivar_types = "".split(",")
162+ @cls_includes = "".split(",", -1)
163+ @cls_ivar_names = "".split(",", -1)
164+ @cls_ivar_types = "".split(",", -1)
165165 # Per-ivar flag: was the ivar's first scanned write a definite
166166 # literal (IntegerNode / FloatNode / StringNode / ...)? Used to
167167 # distinguish concrete-literal writes from best-guess inference
@@ -169,7 +169,7 @@
169169 # definite — non-recognized CallNodes default to "int" through
170170 # infer_ivar_init_type and a naive trust of that produces
171171 # spurious disagreement.
172- @cls_ivar_init_definite = "".split(",")
172+ @cls_ivar_init_definite = "".split(",", -1)
173173 # Per-(class, ivar) accumulator of distinct concrete writer
174174 # types observed by scan_writer_calls. After all writer-scan
175175 # iterations finish, slots with 2+ distinct entries widen to
@@ -181,7 +181,7 @@
181181 # comma-separated list of distinct types per ivar; the outer
182182 # dimension is semicolon-separated and parallel to
183183 # `@cls_ivar_names[ci]`.
184- @cls_ivar_observed_types = "".split(",")
184+ @cls_ivar_observed_types = "".split(",", -1)
185185 # Per-class shadow of `@cls_ivar_types`, populated only by
186186 # `apply_rbs_seeds`. Each entry mirrors `@cls_ivar_names[ci]`'s
187187 # `;`-separated layout: an RBS-pinned slot carries its declared
@@ -189,7 +189,7 @@
189189 # `arbitrate_rbs_vs_inferred_ivars` after the iterative inference
190190 # loop -- when inference and RBS disagree, this table is what
191191 # we restore the slot to. Issue #626 sub-issue 2.
192- @cls_ivar_rbs_types = "".split(",")
192+ @cls_ivar_rbs_types = "".split(",", -1)
193193 # Per-class set of ivar names that are read with a nil predicate
194194 # somewhere in the program — `<ivar>.nil?`, `<ivar> == nil`,
195195 # `<ivar> != nil`. Gates nil-scalar widening to poly so an ivar
@@ -199,7 +199,7 @@
199199 # widening cascaded `@freq` / `@timer` / `@step` to poly and broke
200200 # the int math emit). Populated by scan_ivar_nil_predicates before
201201 # the iter loop; semicolon-joined names parallel to @cls_ivar_names.
202- @cls_ivar_nil_checked = "".split(",")
202+ @cls_ivar_nil_checked = "".split(",", -1)
203203 # Memoization for `find_lv_ivar_alias_in_ast`. Keyed by
204204 # `"<class_idx>:<lv_name>"`, value is the resolved ivar name (or
205205 # `""` when the LV has multiple sources / non-ivar writes).
@@ -226,20 +226,20 @@
226226 # Single-slot caches for the outer "|" split of joined per-class
227227 # method/param fields. cls_meth_ptypes_get / cls_meth_pnames_get /
228228 # cls_cmeth_*_get all do `field[ci].split("|", -1)` then
229- # `[midx].split(",")` — the outer split is repeated for every
229+ # `[midx].split(",", -1)` — the outer split is repeated for every
230230 # (ci, midx) pair. Cache one ci's outer split per field;
231231 # consecutive calls with the same ci skip the outer split.
232232 @cmp_outer_ci = -1
233- @cmp_outer_split = "".split(",")
233+ @cmp_outer_split = "".split(",", -1)
234234 @cmp_outer_version = 0
235235 @cmn_outer_ci = -1
236- @cmn_outer_split = "".split(",")
236+ @cmn_outer_split = "".split(",", -1)
237237 @cmn_outer_version = 0
238238 @ccmp_outer_ci = -1
239- @ccmp_outer_split = "".split(",")
239+ @ccmp_outer_split = "".split(",", -1)
240240 @ccmp_outer_version = 0
241241 @ccmn_outer_ci = -1
242- @ccmn_outer_split = "".split(",")
242+ @ccmn_outer_split = "".split(",", -1)
243243 @ccmn_outer_version = 0
244244 @cls_meth_ptypes_version = 0
245245 @cls_meth_params_version = 0
@@ -247,25 +247,25 @@
247247 @cls_cmeth_params_version = 0
248248 # Top-level (script-scope) ivars. Lowered to `static` file-scope
249249 # globals because `main()` / top-level `def` bodies have no `self`.
250- @toplevel_ivar_names = "".split(",")
251- @toplevel_ivar_types = "".split(",")
252- @cls_meth_names = "".split(",")
253- @cls_meth_params = "".split(",")
254- @cls_meth_ptypes = "".split(",")
255- @cls_meth_returns = "".split(",")
256- @cls_meth_bodies = "".split(",")
257- @cls_meth_defaults = "".split(",")
250+ @toplevel_ivar_names = "".split(",", -1)
251+ @toplevel_ivar_types = "".split(",", -1)
252+ @cls_meth_names = "".split(",", -1)
253+ @cls_meth_params = "".split(",", -1)
254+ @cls_meth_ptypes = "".split(",", -1)
255+ @cls_meth_returns = "".split(",", -1)
256+ @cls_meth_bodies = "".split(",", -1)
257+ @cls_meth_defaults = "".split(",", -1)
258258 # Mirror of @meth_param_empty for class methods. Pipe-separated by
259259 # method, comma-separated by param. .
260- @cls_meth_ptypes_empty = "".split(",")
261- @cls_attr_readers = "".split(",")
262- @cls_attr_writers = "".split(",")
263- @cls_cmeth_names = "".split(",")
264- @cls_cmeth_params = "".split(",")
265- @cls_cmeth_ptypes = "".split(",")
266- @cls_cmeth_returns = "".split(",")
267- @cls_cmeth_bodies = "".split(",")
268- @cls_cmeth_defaults = "".split(",")
260+ @cls_meth_ptypes_empty = "".split(",", -1)
261+ @cls_attr_readers = "".split(",", -1)
262+ @cls_attr_writers = "".split(",", -1)
263+ @cls_cmeth_names = "".split(",", -1)
264+ @cls_cmeth_params = "".split(",", -1)
265+ @cls_cmeth_ptypes = "".split(",", -1)
266+ @cls_cmeth_returns = "".split(",", -1)
267+ @cls_cmeth_bodies = "".split(",", -1)
268+ @cls_cmeth_defaults = "".split(",", -1)
269269 # RBS shadow tables for method ptypes / returns (#626 sub-issue 2
270270 # phase 2). Hash-keyed lookups -- RBS info is sparse compared to
271271 # the dense per-class method tables, so we don't bother mirroring
@@ -289,8 +289,8 @@
289289 # ";" indexes by cmj (mirrors @cls_cmeth_bodies); inner
290290 # separator "|" matches @nd_scope_names' format so the codegen
291291 # consumer can split into the same (lnames, ltypes) pair.
292- @cls_cmeth_scope_names = "".split(",")
293- @cls_cmeth_scope_types = "".split(",")
292+ @cls_cmeth_scope_names = "".split(",", -1)
293+ @cls_cmeth_scope_types = "".split(",", -1)
294294 @cls_is_value_type = []
295295 # SRA (scalar replacement of aggregates) eligibility flag per class.
296296 # Classes marked here can have their non-escaping instances replaced
@@ -299,8 +299,8 @@
299299 @cls_is_sra = []
300300
301301 # ---- Constants (parallel arrays) ----
302- @const_names = "".split(",")
303- @const_types = "".split(",")
302+ @const_names = "".split(",", -1)
303+ @const_types = "".split(",", -1)
304304
305305 # ---- Class variables (@@var) ----
306306 # Per-(class,name) parallel arrays. Storage is a per-class C global
@@ -310,16 +310,16 @@
310310 # are a known footgun (mame, ko1, et al. publicly disrecommend
311311 # them); the simpler per-class semantics fit Spinel's compile-time
312312 # storage model better. Documented in the test fixtures.
313- @cvar_names = "".split(",")
314- @cvar_types = "".split(",")
313+ @cvar_names = "".split(",", -1)
314+ @cvar_types = "".split(",", -1)
315315 # Compile-time literal initializer per cvar, if the class-body
316316 # write was `@@x = <literal>`. "" means "use type-default". This
317317 # is necessary because Spinel doesn't run class-body statements
318318 # at startup, so any initializer that's not a fold-able literal
319319 # leaves the cvar at its type-default until first write.
320- @cvar_init_values = "".split(",")
320+ @cvar_init_values = "".split(",", -1)
321321 @const_expr_ids = []
322- @const_scope_names = "".split(",")
322+ @const_scope_names = "".split(",", -1)
323323 # Parallel to @const_names: when const `<X>`'s init RHS is the
324324 # canonical `<Class>.new(...)` shape, record `<Class>` here so
325325 # codegen can emit the per-const in-progress flag + read-side
@@ -327,27 +327,27 @@
327327 # initialized slot during the same RHS evaluation. Empty string
328328 # means "no guard needed" (other init shape — literal, helper-
329329 # built, etc.). Issue #646.
330- @const_init_class = "".split(",")
330+ @const_init_class = "".split(",", -1)
331331
332332 # `redo` -- labeled-goto target stack. Each loop emitter pushes
333333 # a fresh label name when entering an iteration body and pops on
334334 # exit; a `redo` jumps to the top of the innermost label.
335- @redo_label_stack = "".split(",")
335+ @redo_label_stack = "".split(",", -1)
336336 @redo_label_counter = 0
337337
338338 # `alias $copy $orig` -- maps new gvar name to its target.
339339 # Populated by collect_all from AliasGlobalVariableNode
340340 # statements; consulted by sanitize_gvar / scan_features /
341341 # infer_type so $copy and $orig share storage.
342- @galias_new = "".split(",")
343- @galias_old = "".split(",")
342+ @galias_new = "".split(",", -1)
343+ @galias_old = "".split(",", -1)
344344
345345 # `undef foo` -- per-(class, method-name) registry of removed
346346 # methods. Recorded by collect_class_method_undef; compile-time
347347 # enforcement of "call after undef fails" is currently a
348348 # documented out-of-scope.
349349 @undef_class_idx = []
350- @undef_method = "".split(",")
350+ @undef_method = "".split(",", -1)
351351
352352 # `BEGIN { ... }` bodies, in source-encounter order. Hoisted to
353353 # the top of main() during emit_main.
@@ -360,15 +360,15 @@
360360 @post_execution_blocks = []
361361
362362 # ---- Scope stack for local variables ----
363- @scope_names = "".split(",")
364- @scope_types = "".split(",")
363+ @scope_names = "".split(",", -1)
364+ @scope_types = "".split(",", -1)
365365 # Parallel to `@scope_names`: when a local was assigned directly
366366 # from an ivar read (`lv = @ivar`), record the ivar name here so
367367 # later sites that need ivar-side metadata (notably the
368368 # `<poly>[k]` narrowing in `compile_poly_method_call`) can
369369 # resolve through the alias. Empty string when the local has no
370370 # such alias (or had a non-ivar write since).
371- @scope_ivar_alias = "".split(",")
371+ @scope_ivar_alias = "".split(",", -1)
372372
373373 # Type-narrow stack for `is_a?`/`kind_of?` guards. While walking
374374 # the then-arm of `if v.is_a?(Hash)` or the truthy branch of
@@ -376,8 +376,8 @@
376376 # narrowed_type)` is pushed here; find_var_type's top-down
377377 # lookup picks it up so infer_type / scan / codegen see the
378378 # narrowed type without per-pass plumbing.
379- @type_narrow_names = "".split(",")
380- @type_narrow_types = "".split(",")
379+ @type_narrow_names = "".split(",", -1)
380+ @type_narrow_types = "".split(",", -1)
381381
382382 @current_class_idx = -1
383383 @current_method_name = ""
@@ -414,7 +414,7 @@
414414
415415 # Yield/block tracking (parallel with meth_names / cls_meth_names)
416416 @meth_has_yield = []
417- @cls_meth_has_yield = "".split(",")
417+ @cls_meth_has_yield = "".split(",", -1)
418418
419419 # Block function accumulator (emitted before forward decls)
420420 @block_funcs = ""
@@ -425,7 +425,7 @@
425425 @needs_system = 0
426426 @needs_int_array = 0
427427 @needs_float_array = 0
428- @tuple_types = "".split(",")
428+ @tuple_types = "".split(",", -1)
429429 @needs_str_array = 0
430430 @needs_str_int_hash = 0
431431 @needs_str_str_hash = 0
@@ -438,15 +438,15 @@
438438 # emitted at the top of each rescue body. A bare `raise` inside a
439439 # rescue body re-raises with the snapshotted class+message rather
440440 # than fabricating a fresh RuntimeError. Empty outside any rescue.
441- @rescue_cls_stack = "".split(",")
442- @rescue_msg_stack = "".split(",")
441+ @rescue_cls_stack = "".split(",", -1)
442+ @rescue_msg_stack = "".split(",", -1)
443443 @rescue_depth = 0
444444 # Stack of ensure-clause node IDs (encoded as strings) currently in
445445 # scope. Each entry corresponds to an enclosing `begin..ensure..end`
446446 # whose body is being compiled. When `return` is emitted from inside
447447 # the body, each ensure body is replayed (innermost-first) before
448448 # the C `return`, so writebacks in `ensure` execute on early return.
449- @ensure_stack = "".split(",")
449+ @ensure_stack = "".split(",", -1)
450450 # Number of `sp_exc_top++` pushes emitted along the static
451451 # fall-through path leading to the current emit point but not
452452 # yet matched by an emitted `sp_exc_top--`. An early `return`
@@ -462,15 +462,15 @@
462462 @needs_rb_value = 0
463463 @needs_regexp = 0
464464 @needs_rand = 0
465- @regexp_patterns = "".split(",")
466- @regexp_flags = "".split(",")
465+ @regexp_patterns = "".split(",", -1)
466+ @regexp_flags = "".split(",", -1)
467467 # Dynamic-regex (InterpolatedRegularExpressionNode) call-site cache.
468468 # Each AST node gets a unique idx so the emitter can produce one
469469 # `sp_re_dyn_<idx>` helper per source location with its own
470470 # function-scope cache (string key + compiled pattern). Collected
471471 # in scan_features so indexes are stable across compile_expr visits.
472472 @dyn_regex_node_ids = []
473- @dyn_regex_flags = "".split(",")
473+ @dyn_regex_flags = "".split(",", -1)
474474 # `var = /lit/` resolution. Parallel arrays: `@local_regex_names`
475475 # holds the local-variable name; `@local_regex_idx` holds the
476476 # corresponding `@regexp_patterns` index (-1 when the LV is
@@ -478,7 +478,7 @@
478478 # holds the AST node id of a single-write `Regexp.new(<dyn>)`
479479 # right-hand side (-1 otherwise), so the read-site dyn-cache emit
480480 # can locate the call. Multi-write resets both to -1 / -1.
481- @local_regex_names = "".split(",")
481+ @local_regex_names = "".split(",", -1)
482482 @local_regex_idx = []
483483 @local_regex_call_nids = []
484484
@@ -513,28 +513,28 @@
513513 @needs_sym_poly_hash = 0
514514 @cls_cmeth_live = ""
515515 @cls_meth_live = ""
516- @multi_const_inits = "".split(",")
516+ @multi_const_inits = "".split(",", -1)
517517
518518 # Lambda support
519519 @needs_lambda = 0
520520 @lambda_counter = 0
521521 @lambda_funcs = ""
522- @lambda_params = "".split(",")
523- @lambda_captures = "".split(",")
524- @lambda_capture_cell_types = "".split(",")
525- @lambda_var_ret_names = "".split(",")
526- @lambda_var_ret_types = "".split(",")
522+ @lambda_params = "".split(",", -1)
523+ @lambda_captures = "".split(",", -1)
524+ @lambda_capture_cell_types = "".split(",", -1)
525+ @lambda_var_ret_names = "".split(",", -1)
526+ @lambda_var_ret_types = "".split(",", -1)
527527 @last_lambda_ret_type = ""
528528 # `Klass.method(:cls_meth)` generates an adapter trampoline so the
529529 # Method object's `(void *self, mrb_int...)` ABI fits a class
530530 # method's no-self C signature. Tracks emitted (Klass, method)
531531 # pairs to avoid duplicate definitions.
532- @cls_method_adapters = "".split(",")
532+ @cls_method_adapters = "".split(",", -1)
533533
534534 # Proc closure support (Phase 2)
535535 @in_proc_body = 0
536- @proc_captures = "".split(",")
537- @proc_capture_types = "".split(",")
536+ @proc_captures = "".split(",", -1)
537+ @proc_capture_types = "".split(",", -1)
538538
539539 # Fiber support
540540 @needs_fiber = 0
@@ -548,34 +548,34 @@
548548 @fiber_counter = 0
549549 @fiber_funcs = ""
550550 @in_fiber_body = 0
551- @fiber_captures = "".split(",")
552- @fiber_capture_types = "".split(",")
553- @heap_promoted_names = "".split(",")
554- @heap_promoted_cells = "".split(",")
551+ @fiber_captures = "".split(",", -1)
552+ @fiber_capture_types = "".split(",", -1)
553+ @heap_promoted_names = "".split(",", -1)
554+ @heap_promoted_cells = "".split(",", -1)
555555
556556 # Global variables ($x)
557- @gvar_names = "".split(",")
558- @gvar_types = "".split(",")
557+ @gvar_names = "".split(",", -1)
558+ @gvar_types = "".split(",", -1)
559559
560560 # Poly tracking: functions with params called with different types
561- @poly_funcs = "".split(",")
562- @poly_param_types = "".split(",")
561+ @poly_funcs = "".split(",", -1)
562+ @poly_param_types = "".split(",", -1)
563563
564564 # Method reference tracking: var_name -> method_name
565- @method_ref_vars = "".split(",")
566- @method_ref_names = "".split(",")
565+ @method_ref_vars = "".split(",", -1)
566+ @method_ref_names = "".split(",", -1)
567567
568568 # Open class tracking for built-in types
569- @open_class_names = "".split(",")
569+ @open_class_names = "".split(",", -1)
570570
571571 # Module tracking: module_name -> body node id
572- @module_names = "".split(",")
572+ @module_names = "".split(",", -1)
573573 @module_body_ids = []
574574 # `@module_includes[mi]`: `;`-separated list of names the module
575575 # introduced by row `mi` itself includes. Modules can re-open, so
576576 # each row tracks its own block's `include` calls; const lookup
577577 # walks every row matching the module name.
578- @module_includes = "".split(",")
578+ @module_includes = "".split(",", -1)
579579 # Module-level singleton accessors :
580580 # `class << self; attr_accessor :foo; end` inside `module M`.
581581 # `@module_acc_consts[i]` is a `;`-separated list of distinct
@@ -583,46 +583,46 @@
583583 # inline; Stage 2: multiple names → runtime sentinel switch).
584584 # Empty string means at least one write was non-constant — the
585585 # slot falls through to the un-folded path.
586- @module_acc_keys = "".split(",")
587- @module_acc_consts = "".split(",")
586+ @module_acc_keys = "".split(",", -1)
587+ @module_acc_consts = "".split(",", -1)
588588
589589 # ---- FFI state (parallel arrays, populated by scan_ffi_decl) ----
590590 # Per-module registry:
591- @ffi_modules = "".split(",") # module names that declared FFI
592- @ffi_module_libs = "".split(",") # ";"-joined -l names
593- @ffi_module_cflags = "".split(",") # ";"-joined cc flag strings
591+ @ffi_modules = "".split(",", -1) # module names that declared FFI
592+ @ffi_module_libs = "".split(",", -1) # ";"-joined -l names
593+ @ffi_module_cflags = "".split(",", -1) # ";"-joined cc flag strings
594594 # Function registry (one entry per ffi_func decl):
595- @ffi_func_modules = "".split(",") # owning module name
596- @ffi_func_names = "".split(",") # C symbol name
597- @ffi_func_arg_types = "".split(",") # ";"-joined Spinel type tokens
598- @ffi_func_ret_types = "".split(",") # single Spinel type token
599- @ffi_func_arg_specs = "".split(",") # ";"-joined original specs (uint32, str, …)
600- @ffi_func_ret_specs = "".split(",") # original return spec
595+ @ffi_func_modules = "".split(",", -1) # owning module name
596+ @ffi_func_names = "".split(",", -1) # C symbol name
597+ @ffi_func_arg_types = "".split(",", -1) # ";"-joined Spinel type tokens
598+ @ffi_func_ret_types = "".split(",", -1) # single Spinel type token
599+ @ffi_func_arg_specs = "".split(",", -1) # ";"-joined original specs (uint32, str, …)
600+ @ffi_func_ret_specs = "".split(",", -1) # original return spec
601601 # Buffer registry (one entry per ffi_buffer decl):
602- @ffi_buf_modules = "".split(",")
603- @ffi_buf_names = "".split(",")
602+ @ffi_buf_modules = "".split(",", -1)
603+ @ffi_buf_names = "".split(",", -1)
604604 @ffi_buf_sizes = [] # int sizes in bytes
605605 # Reader registry (one entry per ffi_read_* decl):
606- @ffi_reader_modules = "".split(",")
607- @ffi_reader_names = "".split(",")
608- @ffi_reader_kinds = "".split(",") # "u32", "i32", "ptr"
606+ @ffi_reader_modules = "".split(",", -1)
607+ @ffi_reader_names = "".split(",", -1)
608+ @ffi_reader_kinds = "".split(",", -1) # "u32", "i32", "ptr"
609609 @ffi_reader_offsets = [] # int byte offsets
610610
611611 @pending_method_ref = ""
612612 @lambda_counter = 0
613613 @lambda_funcs = ""
614- @lambda_params = "".split(",")
615- @lambda_captures = "".split(",")
614+ @lambda_params = "".split(",", -1)
615+ @lambda_captures = "".split(",", -1)
616616 @lambda_insert_pos = 0
617- @cls_method_adapters = "".split(",")
617+ @cls_method_adapters = "".split(",", -1)
618618
619619 # Proc closure support (Phase 2)
620620 @in_proc_body = 0
621- @proc_captures = "".split(",")
622- @proc_capture_types = "".split(",")
621+ @proc_captures = "".split(",", -1)
622+ @proc_capture_types = "".split(",", -1)
623623
624624 # Symbol type Phase 2 Step 1: intern table (infrastructure only; unused yet).
625- @sym_names = "".split(",")
625+ @sym_names = "".split(",", -1)
626626
627627 # instance_eval block hoisting: parallel arrays indexed by synthetic
628628 # function id N. Each lifted block becomes a file-scope static
@@ -634,23 +634,23 @@
634634 @ieval_counter = 0
635635 @ieval_class_idxs = []
636636 @ieval_body_ids = []
637- @ieval_return_types = "".split(",")
637+ @ieval_return_types = "".split(",", -1)
638638 # Self-bound block-param name per lift (empty for the no-param
639639 # forms). emit_ieval_func seeds it via `lv_<name> = self;`.
640- @ieval_self_param_names = "".split(",")
640+ @ieval_self_param_names = "".split(",", -1)
641641 # Extra required block-param names (";"-joined) beyond the
642642 # self-bound first. CRuby binds these to nil (arity tolerance);
643643 # precompute_all_scope_decls declares them as nil-typed locals.
644- @ieval_extra_param_names = "".split(",")
644+ @ieval_extra_param_names = "".split(",", -1)
645645 # Receiver classes flagged out of value-type / SRA promotion so
646646 # the lifted sp_ieval_<N>'s self-pointer signature can mutate.
647- @cls_with_internal_ieval_lift = "".split(",")
647+ @cls_with_internal_ieval_lift = "".split(",", -1)
648648
649649 # RBS-derived seed lines. Populated by load_rbs_seeds before
650650 # analyze_phase; consumed by apply_rbs_seeds after collect_all
651651 # has built the class/method tables. Empty when no seed file was
652652 # passed -- inference behaves exactly as before.
653- @rbs_seed_lines = "".split(",")
653+ @rbs_seed_lines = "".split(",", -1)
654654 # Set of "ci_midx" tokens for class instance methods whose ptypes
655655 # were RBS-seeded. Heuristic narrowing passes (notably the
656656 # `narrow_param_hash_types_from_body_writes` Option-B fallback
@@ -658,7 +658,7 @@
658658 # when no concrete writes signal a value type) consult this set
659659 # and skip the narrowing -- the explicit RBS declaration is
660660 # authoritative over heuristic inference. Issue #613.
661- @rbs_seeded_cls_meth = "".split(";")
661+ @rbs_seeded_cls_meth = "".split(";", -1)
662662 end
663663
664664 def rbs_mark_cls_meth_seeded(ci, midx)
@@ -730,7 +730,7 @@
730730
731731 # Returns the body node id for class ci's midx'th method, or -1
732732 # if midx is out of range or the body id is invalid. Centralises
733- # the @cls_meth_bodies[ci].split(";")[midx].to_i parse so detectors
733+ # the @cls_meth_bodies[ci].split(";", -1)[midx].to_i parse so detectors
734734 # don't have to inline it.
735735
736736 # Returns the name of the class method's single proc-typed param
@@ -992,7 +992,7 @@
992992 if incs_str == ""
993993 return ""
994994 end
995- incs = incs_str.split(";")
995+ incs = incs_str.split(";", -1)
996996 ii = 0
997997 while ii < incs.length
998998 inc = incs[ii]
@@ -1422,7 +1422,7 @@
14221422 return "0"
14231423 end
14241424 f = @nd_flags[nid]
1425- parts = "".split(",")
1425+ parts = "".split(",", -1)
14261426 if f & 4 != 0
14271427 parts.push("1")
14281428 end
@@ -1660,7 +1660,7 @@
16601660
16611661 # Find method in class (search parent chain)
16621662 def cls_find_method(ci, mname)
1663- names = @cls_meth_names[ci].split(";")
1663+ names = @cls_meth_names[ci].split(";", -1)
16641664 j = 0
16651665 while j < names.length
16661666 if names[j] == mname
@@ -1714,7 +1714,7 @@
17141714 if ci < 0
17151715 return -1
17161716 end
1717- cmnames = @cls_cmeth_names[ci].split(";")
1717+ cmnames = @cls_cmeth_names[ci].split(";", -1)
17181718 cj = 0
17191719 while cj < cmnames.length
17201720 if cmnames[cj] == mname
@@ -1766,8 +1766,8 @@
17661766 if owner < 0
17671767 return ""
17681768 end
1769- cmnames = @cls_cmeth_names[owner].split(";")
1770- cm_returns = @cls_cmeth_returns[owner].split(";")
1769+ cmnames = @cls_cmeth_names[owner].split(";", -1)
1770+ cm_returns = @cls_cmeth_returns[owner].split(";", -1)
17711771 cj = 0
17721772 while cj < cmnames.length
17731773 if cmnames[cj] == mname
@@ -1786,8 +1786,8 @@
17861786 if @cls_meth_return_cache.key?(ck)
17871787 return @cls_meth_return_cache[ck]
17881788 end
1789- names = @cls_meth_names[ci].split(";")
1790- returns = @cls_meth_returns[ci].split(";")
1789+ names = @cls_meth_names[ci].split(";", -1)
1790+ returns = @cls_meth_returns[ci].split(";", -1)
17911791 j = 0
17921792 while j < names.length
17931793 if names[j] == mname
@@ -1822,8 +1822,8 @@
18221822 if @cls_ivar_type_cache.key?(ck)
18231823 return @cls_ivar_type_cache[ck]
18241824 end
1825- names = @cls_ivar_names[ci].split(";")
1826- types = @cls_ivar_types[ci].split(";")
1825+ names = @cls_ivar_names[ci].split(";", -1)
1826+ types = @cls_ivar_types[ci].split(";", -1)
18271827 own_t = ""
18281828 j = 0
18291829 while j < names.length
@@ -2064,7 +2064,7 @@
20642064 # this arm spinel falls back to int (the default), and string-
20652065 # returning rescue bodies fail C compilation when the ret_tmp
20662066 # slot's type doesn't match the value being assigned.
2067- types_b = "".split(",")
2067+ types_b = "".split(",", -1)
20682068 bodies_b = begin_node_arm_bodies(nid)
20692069 bi = 0
20702070 while bi < bodies_b.length
@@ -2315,7 +2315,7 @@
23152315 else_type = infer_type(sub)
23162316 end
23172317 end
2318- types = "".split(",")
2318+ types = "".split(",", -1)
23192319 types.push(then_type)
23202320 types.push(else_type)
23212321 return unify_return_type(types)
@@ -2340,13 +2340,13 @@
23402340 end
23412341 end
23422342 end
2343- types = "".split(",")
2343+ types = "".split(",", -1)
23442344 types.push(then_type)
23452345 types.push(else_type)
23462346 return unify_return_type(types)
23472347 end
23482348 if t == "CaseMatchNode"
2349- types = "".split(",")
2349+ types = "".split(",", -1)
23502350 conds = parse_id_list(@nd_conditions[nid])
23512351 k = 0
23522352 while k < conds.length
@@ -2378,7 +2378,7 @@
23782378 return "int"
23792379 end
23802380 if t == "CaseNode"
2381- types = "".split(",")
2381+ types = "".split(",", -1)
23822382 conds = parse_id_list(@nd_conditions[nid])
23832383 k = 0
23842384 while k < conds.length
@@ -2955,7 +2955,7 @@
29552955 if module_name_exists(mod_name) == 1
29562956 rconsts = module_acc_resolved(mod_name, inner_mname)
29572957 if rconsts != "" && rconsts != "?"
2958- cands = rconsts.split(";")
2958+ cands = rconsts.split(";", -1)
29592959 common = ""
29602960 cands.each { |cn|
29612961 mi = find_method_idx(cn + "_cls_" + mname)
@@ -3135,8 +3135,8 @@
31353135 end
31363136 cci_cm = find_class_idx(owning_cm)
31373137 if cci_cm >= 0
3138- cmnames_cm = @cls_cmeth_names[cci_cm].split(";")
3139- cmreturns_cm = @cls_cmeth_returns[cci_cm].split(";")
3138+ cmnames_cm = @cls_cmeth_names[cci_cm].split(";", -1)
3139+ cmreturns_cm = @cls_cmeth_returns[cci_cm].split(";", -1)
31403140 cmidx_cm = 0
31413141 while cmidx_cm < cmnames_cm.length
31423142 if cmnames_cm[cmidx_cm] == mname && cmidx_cm < cmreturns_cm.length
@@ -3148,8 +3148,8 @@
31483148 end
31493149 end
31503150 if @current_class_idx >= 0 && @current_method_has_self == 0
3151- cmnames_cm_r = @cls_cmeth_names[@current_class_idx].split(";")
3152- cmreturns_cm_r = @cls_cmeth_returns[@current_class_idx].split(";")
3151+ cmnames_cm_r = @cls_cmeth_names[@current_class_idx].split(";", -1)
3152+ cmreturns_cm_r = @cls_cmeth_returns[@current_class_idx].split(";", -1)
31533153 cmidx_cm_r = 0
31543154 while cmidx_cm_r < cmnames_cm_r.length
31553155 if cmnames_cm_r[cmidx_cm_r] == mname && cmidx_cm_r < cmreturns_cm_r.length
@@ -3653,7 +3653,7 @@
36533653 def any_user_class_defines_imeth(mname)
36543654 ck = 0
36553655 while ck < @cls_names.length
3656- names = @cls_meth_names[ck].split(";")
3656+ names = @cls_meth_names[ck].split(";", -1)
36573657 kk = 0
36583658 while kk < names.length
36593659 if names[kk] == mname
@@ -3963,8 +3963,8 @@
39633963 if inner_ci >= 0
39643964 owner = cls_cmethod_owner(inner_ci, mname)
39653965 if owner >= 0
3966- cmnames = @cls_cmeth_names[owner].split(";")
3967- cmreturns = @cls_cmeth_returns[owner].split(";")
3966+ cmnames = @cls_cmeth_names[owner].split(";", -1)
3967+ cmreturns = @cls_cmeth_returns[owner].split(";", -1)
39683968 base_rt = ""
39693969 cmidx = 0
39703970 while cmidx < cmnames.length
@@ -3989,8 +3989,8 @@
39893989 if ck != inner_ci && cls_is_descendant(ck, inner_ci) == 1
39903990 own = cls_cmethod_owner(ck, mname)
39913991 if own == ck
3992- ck_cmnames = @cls_cmeth_names[ck].split(";")
3993- ck_cmreturns = @cls_cmeth_returns[ck].split(";")
3992+ ck_cmnames = @cls_cmeth_names[ck].split(";", -1)
3993+ ck_cmreturns = @cls_cmeth_returns[ck].split(";", -1)
39943994 ki = 0
39953995 while ki < ck_cmnames.length
39963996 if ck_cmnames[ki] == mname && ki < ck_cmreturns.length
@@ -5106,7 +5106,7 @@
51065106 end
51075107 if heterogeneous == 1 || multi_arg == 1
51085108 # Build tuple type: receiver elem + each arg elem
5109- parts = "".split(",")
5109+ parts = "".split(",", -1)
51105110 parts.push(elem_type_of_array(rt))
51115111 aargs2 = get_args(args_id)
51125112 k2 = 0
@@ -5962,7 +5962,7 @@
59625962 # that the dispatch site source-level can't reach (mirrors
59635963 # codegen-side narrow). Issue #549.
59645964 args_id_pdrt = @nd_arguments[nid]
5965- arg_types_pdrt = "".split(",")
5965+ arg_types_pdrt = "".split(",", -1)
59665966 if args_id_pdrt >= 0
59675967 a_ids_pdrt = get_args(args_id_pdrt)
59685968 kp_pdrt = 0
@@ -6024,7 +6024,7 @@
60246024 ci = 0
60256025 while ci < @cls_names.length
60266026 # Check zero-arg methods (getters)
6027- ci2_mnames = @cls_meth_names[ci].split(";")
6027+ ci2_mnames = @cls_meth_names[ci].split(";", -1)
60286028 ci2_mparams = @cls_meth_params[ci].split("|", -1)
60296029 mi2 = 0
60306030 while mi2 < ci2_mnames.length
@@ -6209,7 +6209,7 @@
62096209 end
62106210
62116211 def tuple_elem_type_at(t, idx)
6212- parts = tuple_elem_types_str(t).split(",")
6212+ parts = tuple_elem_types_str(t).split(",", -1)
62136213 if idx < parts.length
62146214 return parts[idx]
62156215 end
@@ -6244,7 +6244,7 @@
62446244
62456245 # Build "tuple:T0,T1,..." from a list of element node ids and register it.
62466246 def tuple_type_from_elems(elems)
6247- parts = "".split(",")
6247+ parts = "".split(",", -1)
62486248 k = 0
62496249 while k < elems.length
62506250 parts.push(infer_type(elems[k]))
@@ -6567,7 +6567,7 @@
65676567 if ci < 0
65686568 return 0
65696569 end
6570- writers = @cls_attr_writers[ci].split(";")
6570+ writers = @cls_attr_writers[ci].split(";", -1)
65716571 wi = 0
65726572 while wi < writers.length
65736573 if writers[wi] == bname
@@ -6796,7 +6796,7 @@
67966796 if arg_ids.length > 0 && @nd_type[arg_ids[0]] == "ConstantReadNode"
67976797 rhs_name = @nd_name[arg_ids[0]]
67986798 cur = @module_acc_consts[idx]
6799- cur_list = cur.split(";")
6799+ cur_list = cur.split(";", -1)
68006800 if not_in(rhs_name, cur_list) == 1
68016801 if cur == ""
68026802 @module_acc_consts[idx] = rhs_name
@@ -6871,16 +6871,16 @@
68716871 def propagate_inherited_class_methods
68726872 ci = 0
68736873 while ci < @cls_names.length
6874- seen = @cls_cmeth_names[ci].split(";")
6874+ seen = @cls_cmeth_names[ci].split(";", -1)
68756875 cur_parent = @cls_parents[ci]
68766876 while cur_parent != ""
68776877 pi = find_class_idx(cur_parent)
68786878 if pi < 0
68796879 cur_parent = ""
68806880 else
6881- p_cmnames = @cls_cmeth_names[pi].split(";")
6882- p_cmreturns = @cls_cmeth_returns[pi].split(";")
6883- p_cmbodies = @cls_cmeth_bodies[pi].split(";")
6881+ p_cmnames = @cls_cmeth_names[pi].split(";", -1)
6882+ p_cmreturns = @cls_cmeth_returns[pi].split(";", -1)
6883+ p_cmbodies = @cls_cmeth_bodies[pi].split(";", -1)
68846884 p_cmparams = @cls_cmeth_params[pi].split("|", -1)
68856885 p_cmptypes = @cls_cmeth_ptypes[pi].split("|", -1)
68866886 p_cmdefaults = @cls_cmeth_defaults[pi].split("|", -1)
@@ -6923,7 +6923,7 @@
69236923 def detect_circular_inheritance
69246924 i = 0
69256925 while i < @cls_names.length
6926- visited = "".split(",")
6926+ visited = "".split(",", -1)
69276927 visited.push(@cls_names[i])
69286928 cur = @cls_parents[i]
69296929 while cur != ""
@@ -7137,10 +7137,10 @@
71377137 # from analyze get appended to instead of replaced.
71387138 @ieval_class_idxs = []
71397139 @ieval_body_ids = []
7140- @ieval_return_types = "".split(",")
7141- @ieval_self_param_names = "".split(",")
7142- @ieval_extra_param_names = "".split(",")
7143- @cls_with_internal_ieval_lift = "".split(",")
7140+ @ieval_return_types = "".split(",", -1)
7141+ @ieval_self_param_names = "".split(",", -1)
7142+ @ieval_extra_param_names = "".split(",", -1)
7143+ @cls_with_internal_ieval_lift = "".split(",", -1)
71447144 # Widen class-method ptypes through obj-typed receivers before the
71457145 # walk so a method-param receiver (e.g. `def configure(app);
71467146 # app.instance_eval { } end` invoked as `cfg.configure(routes)`)
@@ -7183,7 +7183,7 @@
71837183 ci = 0
71847184 while ci < @cls_names.length
71857185 @current_class_idx = ci
7186- bodies = @cls_meth_bodies[ci].split(";")
7186+ bodies = @cls_meth_bodies[ci].split(";", -1)
71877187 bj = 0
71887188 while bj < bodies.length
71897189 bid = bodies[bj].to_i
@@ -7204,8 +7204,8 @@
72047204 # infer_all_returns does in its class-methods preamble
72057205 # (Pass 3). Pulls in `routes = Routes.new` with type
72067206 # obj_Routes when the RHS is statically classifiable.
7207- lnames = "".split(",")
7208- ltypes = "".split(",")
7207+ lnames = "".split(",", -1)
7208+ ltypes = "".split(",", -1)
72097209 scan_locals_first_type(bid, lnames, ltypes, pnames)
72107210 lk = 0
72117211 while lk < lnames.length
@@ -7372,7 +7372,7 @@
73727372 # needing extra args at the call boundary (opts/posts/rest/kw/
73737373 # kwrest/&blk) or on `_2`+ numbered params.
73747374 self_param_name = ""
7375- extra_param_names = "".split(",")
7375+ extra_param_names = "".split(",", -1)
73767376 bp = @nd_parameters[blk]
73777377 if bp >= 0
73787378 if @nd_type[bp] == "NumberedParametersNode"
@@ -7947,7 +7947,7 @@
79477947
79487948 parent = ""
79497949 sp = @nd_superclass[nid]
7950- struct_fields = "".split(",")
7950+ struct_fields = "".split(",", -1)
79517951 if sp >= 0
79527952 if @nd_type[sp] == "CallNode"
79537953 if @nd_name[sp] == "new"
@@ -8288,8 +8288,8 @@
82888288 end
82898289 pnames_all = @cls_meth_params[ci].split("|", -1)
82908290 ptypes_all = @cls_meth_ptypes[ci].split("|", -1)
8291- rets_all = @cls_meth_returns[ci].split(";")
8292- bodies_all = @cls_meth_bodies[ci].split(";")
8291+ rets_all = @cls_meth_returns[ci].split(";", -1)
8292+ bodies_all = @cls_meth_bodies[ci].split(";", -1)
82938293 defs_all = @cls_meth_defaults[ci].split("|", -1)
82948294 params = pnames_all[src] || ""
82958295 ptypes = ptypes_all[src] || ""
@@ -8314,7 +8314,7 @@
83148314 # then walks to the parent (or returns -1), so `c.meth` after
83158315 # `undef meth` raises NoMethodError just like CRuby. Issue #717.
83168316 if @cls_meth_names[ci] != ""
8317- cur_names_u = @cls_meth_names[ci].split(";")
8317+ cur_names_u = @cls_meth_names[ci].split(";", -1)
83188318 hit_u = -1
83198319 ki_u = 0
83208320 while ki_u < cur_names_u.length
@@ -8328,8 +8328,8 @@
83288328 if hit_u >= 0
83298329 cur_params_u = @cls_meth_params[ci].split("|", -1)
83308330 cur_ptypes_u = @cls_meth_ptypes[ci].split("|", -1)
8331- cur_returns_u = @cls_meth_returns[ci].split(";")
8332- cur_bodies_u = @cls_meth_bodies[ci].split(";")
8331+ cur_returns_u = @cls_meth_returns[ci].split(";", -1)
8332+ cur_bodies_u = @cls_meth_bodies[ci].split(";", -1)
83338333 cur_defaults_u = @cls_meth_defaults[ci].split("|", -1)
83348334 cur_pempty_u = @cls_meth_ptypes_empty[ci].split("|", -1)
83358335 while cur_pempty_u.length < cur_names_u.length
@@ -8397,7 +8397,7 @@
83978397 end
83988398 cur = @cls_includes[ci]
83998399 # Dedup: a re-included module shouldn't duplicate in ancestors.
8400- parts = cur.split(";")
8400+ parts = cur.split(";", -1)
84018401 pk = 0
84028402 while pk < parts.length
84038403 if parts[pk] == mod_name
@@ -8526,7 +8526,7 @@
85268526 mname_e = @nd_name[sid]
85278527 # Only add if this class doesn't already have a class
85288528 # method with that name.
8529- cm_names_e = @cls_cmeth_names[ci].split(";")
8529+ cm_names_e = @cls_cmeth_names[ci].split(";", -1)
85308530 already_e = 0
85318531 ki_e = 0
85328532 while ki_e < cm_names_e.length
@@ -8576,7 +8576,7 @@
85768576 includes_str = @cls_includes[ci]
85778577 if includes_str != ""
85788578 before_meths = @cls_meth_names[ci]
8579- names = includes_str.split(";")
8579+ names = includes_str.split(";", -1)
85808580 ni = 0
85818581 while ni < names.length
85828582 if names[ni] != ""
@@ -8961,11 +8961,11 @@
89618961 # user can spot the divergence from CRuby's intermediate-version
89628962 # behaviour.
89638963 $stderr.puts "warning: method '" + name + "' on " + @cls_names[ci] + " is being redefined; spinel uses last-def-wins semantics (calls before the redefinition won't see the original body — subset limitation)"
8964- cur_names = @cls_meth_names[ci].split(";")
8964+ cur_names = @cls_meth_names[ci].split(";", -1)
89658965 cur_params = @cls_meth_params[ci].split("|", -1)
89668966 cur_ptypes = @cls_meth_ptypes[ci].split("|", -1)
8967- cur_returns = @cls_meth_returns[ci].split(";")
8968- cur_bodies = @cls_meth_bodies[ci].split(";")
8967+ cur_returns = @cls_meth_returns[ci].split(";", -1)
8968+ cur_bodies = @cls_meth_bodies[ci].split(";", -1)
89698969 cur_defaults = @cls_meth_defaults[ci].split("|", -1)
89708970 cur_pempty = @cls_meth_ptypes_empty[ci].split("|", -1)
89718971 while cur_pempty.length < cur_names.length
@@ -9032,7 +9032,7 @@
90329032 # Class re-open semantics for `def self.<m>` (#489).
90339033 # Last-definition-wins, same shape as append_cls_meth above.
90349034 if @cls_cmeth_names[ci] != ""
9035- cm_names_re = @cls_cmeth_names[ci].split(";")
9035+ cm_names_re = @cls_cmeth_names[ci].split(";", -1)
90369036 existing_cmi = 0
90379037 found_cmi = -1
90389038 while existing_cmi < cm_names_re.length
@@ -9046,8 +9046,8 @@
90469046 if found_cmi >= 0
90479047 cur_cm_params = @cls_cmeth_params[ci].split("|", -1)
90489048 cur_cm_ptypes = @cls_cmeth_ptypes[ci].split("|", -1)
9049- cur_cm_returns = @cls_cmeth_returns[ci].split(";")
9050- cur_cm_bodies = @cls_cmeth_bodies[ci].split(";")
9049+ cur_cm_returns = @cls_cmeth_returns[ci].split(";", -1)
9050+ cur_cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
90519051 cur_cm_defaults = @cls_cmeth_defaults[ci].split("|", -1)
90529052 cm_names_re[found_cmi] = name
90539053 if found_cmi < cur_cm_params.length
@@ -9147,7 +9147,7 @@
91479147
91489148 def collect_ivars(ci)
91499149 # Scan all methods for ivar writes
9150- meths = @cls_meth_bodies[ci].split(";")
9150+ meths = @cls_meth_bodies[ci].split(";", -1)
91519151 j = 0
91529152 while j < meths.length
91539153 bid = meths[j].to_i
@@ -9157,7 +9157,7 @@
91579157 j = j + 1
91589158 end
91599159 # Add ivars from attr_readers/writers that might not have explicit writes
9160- readers = @cls_attr_readers[ci].split(";")
9160+ readers = @cls_attr_readers[ci].split(";", -1)
91619161 j = 0
91629162 while j < readers.length
91639163 iname = "@" + readers[j]
@@ -9166,7 +9166,7 @@
91669166 end
91679167 j = j + 1
91689168 end
9169- writers = @cls_attr_writers[ci].split(";")
9169+ writers = @cls_attr_writers[ci].split(";", -1)
91709170 j = 0
91719171 while j < writers.length
91729172 iname = "@" + writers[j]
@@ -9182,8 +9182,8 @@
91829182 # already determined the new type is correct (e.g. promoting an
91839183 # empty-hash default to a concrete hash type from a `[]=` write).
91849184 def replace_ivar_type(ci, iname, new_type)
9185- names = @cls_ivar_names[ci].split(";")
9186- types = @cls_ivar_types[ci].split(";")
9185+ names = @cls_ivar_names[ci].split(";", -1)
9186+ types = @cls_ivar_types[ci].split(";", -1)
91879187 k = 0
91889188 while k < names.length
91899189 if names[k] == iname
@@ -9204,8 +9204,8 @@
92049204 end
92059205
92069206 def update_ivar_type(ci, iname, new_type)
9207- names = @cls_ivar_names[ci].split(";")
9208- types = @cls_ivar_types[ci].split(";")
9207+ names = @cls_ivar_names[ci].split(";", -1)
9208+ types = @cls_ivar_types[ci].split(";", -1)
92099209 k = 0
92109210 while k < names.length
92119211 if names[k] == iname
@@ -9323,7 +9323,7 @@
93239323 end
93249324
93259325 def ivar_exists(ci, iname)
9326- names = @cls_ivar_names[ci].split(";")
9326+ names = @cls_ivar_names[ci].split(";", -1)
93279327 k = 0
93289328 while k < names.length
93299329 if names[k] == iname
@@ -9395,8 +9395,8 @@
93959395 # one per `<Class>.new(args)` callsite. Plain arrays instead of a Hash
93969396 # because the empty-hash-literal default type would land on
93979397 # str_int_hash and reject the string values.
9398- ctor_class_idxs = "".split(",")
9399- ctor_arg_csvs = "".split(",")
9398+ ctor_class_idxs = "".split(",", -1)
9399+ ctor_arg_csvs = "".split(",", -1)
94009400 nid = 0
94019401 n = @nd_type.length
94029402 while nid < n
@@ -9434,7 +9434,7 @@
94349434 # matching arg type as an observation.
94359435 ci = 0
94369436 while ci < @cls_names.length
9437- callsites = "".split(",")
9437+ callsites = "".split(",", -1)
94389438 ki = 0
94399439 ci_str = ci.to_s
94409440 while ki < ctor_class_idxs.length
@@ -9446,7 +9446,7 @@
94469446 if callsites.length > 0
94479447 init_midx = cls_find_method_direct(ci, "initialize")
94489448 if init_midx >= 0
9449- bodies = @cls_meth_bodies[ci].split(";")
9449+ bodies = @cls_meth_bodies[ci].split(";", -1)
94509450 if init_midx < bodies.length
94519451 init_body = bodies[init_midx].to_i
94529452 if init_body >= 0
@@ -9523,7 +9523,7 @@
95239523 if is_concrete == 0
95249524 return
95259525 end
9526- names = @cls_ivar_names[ci].split(";")
9526+ names = @cls_ivar_names[ci].split(";", -1)
95279527 # Pad obs to names.length: split(";", -1) preserves trailing "" but
95289528 # an entirely-empty storage gives a 0-length array. Walk by index
95299529 # and treat missing entries as "".
@@ -9532,7 +9532,7 @@
95329532 while k < names.length
95339533 if names[k] == iname
95349534 # Build an array of slots, one per ivar, defaulting empty.
9535- slots = "".split(",")
9535+ slots = "".split(",", -1)
95369536 ix = 0
95379537 while ix < names.length
95389538 slots.push("")
@@ -9546,7 +9546,7 @@
95469546 px = px + 1
95479547 end
95489548 end
9549- existing = slots[k].split(",")
9549+ existing = slots[k].split(",", -1)
95509550 ex = 0
95519551 while ex < existing.length
95529552 if existing[ex] == at
@@ -9644,8 +9644,8 @@
96449644 end
96459645
96469646 def cls_ivar_definite_flag(ci, iname)
9647- names = @cls_ivar_names[ci].split(";")
9648- flags = @cls_ivar_init_definite[ci].split(";")
9647+ names = @cls_ivar_names[ci].split(";", -1)
9648+ flags = @cls_ivar_init_definite[ci].split(";", -1)
96499649 k = 0
96509650 while k < names.length
96519651 if names[k] == iname
@@ -9676,7 +9676,7 @@
96769676 if @cls_ivar_nil_checked[ci] == ""
96779677 return 0
96789678 end
9679- names = @cls_ivar_nil_checked[ci].split(";")
9679+ names = @cls_ivar_nil_checked[ci].split(";", -1)
96809680 k = 0
96819681 while k < names.length
96829682 if names[k] == iname
@@ -10625,7 +10625,7 @@
1062510625 cur_incs = @module_includes[mi_for_includes]
1062610626 already = 0
1062710627 if cur_incs != ""
10628- parts = cur_incs.split(";")
10628+ parts = cur_incs.split(";", -1)
1062910629 pk = 0
1063010630 while pk < parts.length
1063110631 if parts[pk] == inc_name
@@ -10874,9 +10874,9 @@
1087410874 (cur == "nil" && @nd_type[expr_id] == "NilNode")
1087510875 # Walk all class methods in the module looking for writes to
1087610876 # this ivar.
10877- key_t_set = "".split(",")
10878- val_t_set = "".split(",")
10879- direct_t_set = "".split(",")
10877+ key_t_set = "".split(",", -1)
10878+ val_t_set = "".split(",", -1)
10879+ direct_t_set = "".split(",", -1)
1088010880 body_stmts.each { |sid2|
1088110881 next unless @nd_type[sid2] == "DefNode"
1088210882 bid = @nd_body[sid2]
@@ -10890,8 +10890,8 @@
1089010890 mi3 = find_method_idx(synth_name)
1089110891 push_scope
1089210892 if mi3 >= 0
10893- pnames3 = @meth_param_names[mi3].split(",")
10894- ptypes3 = @meth_param_types[mi3].split(",")
10893+ pnames3 = @meth_param_names[mi3].split(",", -1)
10894+ ptypes3 = @meth_param_types[mi3].split(",", -1)
1089510895 k3 = 0
1089610896 while k3 < pnames3.length
1089710897 pt3 = "int"
@@ -10909,8 +10909,8 @@
1090910909 # pick_array_class returns the same int_array we started
1091010910 # with. The ivar shape (`@slots[k] = v` where k/v are
1091110911 # params) only needs the params declared above.
10912- local_names = "".split(",")
10913- local_types = "".split(",")
10912+ local_names = "".split(",", -1)
10913+ local_types = "".split(",", -1)
1091410914 scan_locals(bid, local_names, local_types, pnames3)
1091510915 lk = 0
1091610916 while lk < local_names.length
@@ -11536,7 +11536,7 @@
1153611536 return
1153711537 end
1153811538 if @multi_const_inits == nil
11539- @multi_const_inits = "".split(",")
11539+ @multi_const_inits = "".split(",", -1)
1154011540 end
1154111541 @multi_const_inits.push(scope_name + "|" + nid.to_s)
1154211542 end
@@ -11630,7 +11630,7 @@
1163011630
1163111631 # Get field names from symbol args (skip keyword_init hash)
1163211632 args_id = @nd_arguments[call_nid]
11633- field_names = "".split(",")
11633+ field_names = "".split(",", -1)
1163411634 if args_id >= 0
1163511635 aids = get_args(args_id)
1163611636 k = 0
@@ -11673,7 +11673,7 @@
1167311673
1167411674 # Store struct info for synthetic constructor generation
1167511675 # We'll use a special marker in the body id (-2 = synthetic struct)
11676- bodies = @cls_meth_bodies[ci].split(";")
11676+ bodies = @cls_meth_bodies[ci].split(";", -1)
1167711677 if bodies.length > 0
1167811678 bodies[0] = "-2"
1167911679 @cls_meth_bodies[ci] = bodies.join(";")
@@ -11744,9 +11744,9 @@
1174411744 if @nd_type[@root_id] == "ProgramNode"
1174511745 tl_body = @nd_body[@root_id]
1174611746 if tl_body >= 0
11747- empty_params = "".split(",")
11748- tl_lnames = "".split(",")
11749- tl_ltypes = "".split(",")
11747+ empty_params = "".split(",", -1)
11748+ tl_lnames = "".split(",", -1)
11749+ tl_ltypes = "".split(",", -1)
1175011750 scan_locals_first_type(tl_body, tl_lnames, tl_ltypes, empty_params)
1175111751 ti = 0
1175211752 while ti < tl_lnames.length
@@ -12181,9 +12181,9 @@
1218112181 # arg infers off the local's literal type. The same guard keeps
1218212182 # nested def/class/module bodies from leaking back out.
1218312183 push_scope
12184- lnames = "".split(",")
12185- ltypes = "".split(",")
12186- empty_p = "".split(",")
12184+ lnames = "".split(",", -1)
12185+ ltypes = "".split(",", -1)
12186+ empty_p = "".split(",", -1)
1218712187 scan_locals(body, lnames, ltypes, empty_p)
1218812188 k = 0
1218912189 while k < lnames.length
@@ -12239,8 +12239,8 @@
1223912239 args_id = @nd_arguments[nid]
1224012240 if args_id >= 0
1224112241 arg_ids = get_args(args_id)
12242- ptypes = @meth_param_types[mi].split(",")
12243- pnames = @meth_param_names[mi].split(",")
12242+ ptypes = @meth_param_types[mi].split(",", -1)
12243+ pnames = @meth_param_names[mi].split(",", -1)
1224412244 rest_param_idx = method_rest_index(mi)
1224512245 if rest_param_idx >= ptypes.length
1224612246 rest_param_idx = -1
@@ -12366,7 +12366,7 @@
1236612366 owning = @current_method_name[0, marker]
1236712367 cci = find_class_idx(owning)
1236812368 if cci >= 0
12369- cmnames = @cls_cmeth_names[cci].split(";")
12369+ cmnames = @cls_cmeth_names[cci].split(";", -1)
1237012370 cmidx = 0
1237112371 while cmidx < cmnames.length
1237212372 if cmnames[cmidx] == mname
@@ -12391,8 +12391,8 @@
1239112391 args_id_m = @nd_arguments[nid]
1239212392 if args_id_m >= 0
1239312393 arg_ids_m = get_args(args_id_m)
12394- ptypes_m = @meth_param_types[sib_mi_m].split(",")
12395- pnames_m = @meth_param_names[sib_mi_m].split(",")
12394+ ptypes_m = @meth_param_types[sib_mi_m].split(",", -1)
12395+ pnames_m = @meth_param_names[sib_mi_m].split(",", -1)
1239612396 widen_ptypes_from_args(arg_ids_m, pnames_m, ptypes_m)
1239712397 @meth_param_types[sib_mi_m] = ptypes_m.join(",")
1239812398 end
@@ -12566,9 +12566,9 @@
1256612566 arg_ids_p = get_args(args_id_p)
1256712567 obs_ids = observed_class_ids_for_recv(@nd_receiver[nid], @current_class_idx)
1256812568 obs_filter = (obs_ids != "")
12569- obs_list = "".split(",")
12569+ obs_list = "".split(",", -1)
1257012570 if obs_filter
12571- obs_list = obs_ids.split(",")
12571+ obs_list = obs_ids.split(",", -1)
1257212572 end
1257312573 ci_p = 0
1257412574 while ci_p < @cls_names.length
@@ -12620,7 +12620,7 @@
1262012620 cci = find_class_idx(rcname)
1262112621 if cci >= 0
1262212622 cmname = @nd_name[nid]
12623- cmnames = @cls_cmeth_names[cci].split(";")
12623+ cmnames = @cls_cmeth_names[cci].split(";", -1)
1262412624 cmidx = 0
1262512625 while cmidx < cmnames.length
1262612626 if cmnames[cmidx] == cmname
@@ -12654,8 +12654,8 @@
1265412654 mod_args_id = @nd_arguments[nid]
1265512655 if mod_args_id >= 0
1265612656 mod_arg_ids = get_args(mod_args_id)
12657- mod_pnames = @meth_param_names[mod_mi].split(",")
12658- mod_ptypes = @meth_param_types[mod_mi].split(",")
12657+ mod_pnames = @meth_param_names[mod_mi].split(",", -1)
12658+ mod_ptypes = @meth_param_types[mod_mi].split(",", -1)
1265912659 widen_ptypes_from_args(mod_arg_ids, mod_pnames, mod_ptypes)
1266012660 @meth_param_types[mod_mi] = mod_ptypes.join(",")
1266112661 end
@@ -12682,7 +12682,7 @@
1268212682 if module_name_exists(mua_mod_name) == 1
1268312683 mua_rconsts = module_acc_resolved(mua_mod_name, mua_inner_mname)
1268412684 if mua_rconsts != "" && mua_rconsts != "?"
12685- mua_cands = mua_rconsts.split(";")
12685+ mua_cands = mua_rconsts.split(";", -1)
1268612686 mua_outer_mname = @nd_name[nid]
1268712687 mua_args_id = @nd_arguments[nid]
1268812688 if mua_args_id >= 0
@@ -12690,12 +12690,12 @@
1269012690 mua_cands.each { |mua_cn|
1269112691 mua_cci = find_class_idx(mua_cn)
1269212692 if mua_cci >= 0
12693- mua_cmnames = @cls_cmeth_names[mua_cci].split(";")
12693+ mua_cmnames = @cls_cmeth_names[mua_cci].split(";", -1)
1269412694 mua_cmpall = @cls_cmeth_ptypes[mua_cci].split("|", -1)
1269512695 mua_cmidx = 0
1269612696 while mua_cmidx < mua_cmnames.length
1269712697 if mua_cmnames[mua_cmidx] == mua_outer_mname && mua_cmidx < mua_cmpall.length
12698- mua_cmpt = mua_cmpall[mua_cmidx].split(",")
12698+ mua_cmpt = mua_cmpall[mua_cmidx].split(",", -1)
1269912699 mua_k = 0
1270012700 while mua_k < mua_arg_ids.length
1270112701 mua_at = infer_type(mua_arg_ids[mua_k])
@@ -12722,8 +12722,8 @@
1272212722 mua_mod_mfn = mua_cn + "_cls_" + mua_outer_mname
1272312723 mua_mod_mi = find_method_idx(mua_mod_mfn)
1272412724 if mua_mod_mi >= 0
12725- mua_mod_pnames = @meth_param_names[mua_mod_mi].split(",")
12726- mua_mod_ptypes = @meth_param_types[mua_mod_mi].split(",")
12725+ mua_mod_pnames = @meth_param_names[mua_mod_mi].split(",", -1)
12726+ mua_mod_ptypes = @meth_param_types[mua_mod_mi].split(",", -1)
1272712727 widen_ptypes_from_args(mua_arg_ids, mua_mod_pnames, mua_mod_ptypes)
1272812728 @meth_param_types[mua_mod_mi] = mua_mod_ptypes.join(",")
1272912729 end
@@ -12903,7 +12903,7 @@
1290312903 if child_init_idx < 0
1290412904 return
1290512905 end
12906- bodies = @cls_meth_bodies[child_ci].split(";")
12906+ bodies = @cls_meth_bodies[child_ci].split(";", -1)
1290712907 if child_init_idx >= bodies.length
1290812908 return
1290912909 end
@@ -12929,7 +12929,7 @@
1292912929 ci = 0
1293012930 while ci < @cls_names.length
1293112931 if @cls_parents[ci] != ""
12932- child_method_names = @cls_meth_names[ci].split(";")
12932+ child_method_names = @cls_meth_names[ci].split(";", -1)
1293312933 j = 0
1293412934 while j < child_method_names.length
1293512935 mname = child_method_names[j]
@@ -12961,7 +12961,7 @@
1296112961 end
1296212962
1296312963 def propagate_super_method_one(child_ci, child_mi, parent_ci, mname)
12964- bodies = @cls_meth_bodies[child_ci].split(";")
12964+ bodies = @cls_meth_bodies[child_ci].split(";", -1)
1296512965 if child_mi >= bodies.length
1296612966 return
1296712967 end
@@ -13053,8 +13053,8 @@
1305313053 def propagate_bare_new_to_subclass_initialize
1305413054 ci = 0
1305513055 while ci < @cls_names.length
13056- cmnames = @cls_cmeth_names[ci].split(";")
13057- cm_bodies = @cls_cmeth_bodies[ci].split(";")
13056+ cmnames = @cls_cmeth_names[ci].split(";", -1)
13057+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
1305813058 j = 0
1305913059 while j < cmnames.length
1306013060 bid = -1
@@ -13178,7 +13178,7 @@
1317813178 while i < @cls_names.length
1317913179 init_idx2 = cls_find_method_direct(i, "initialize")
1318013180 if init_idx2 >= 0
13181- bodies = @cls_meth_bodies[i].split(";")
13181+ bodies = @cls_meth_bodies[i].split(";", -1)
1318213182 if init_idx2 < bodies.length
1318313183 if bodies[init_idx2].to_i == -2
1318413184 # Synthetic struct - update ivar types from init param types
@@ -13202,13 +13202,13 @@
1320213202 # For each class method, if it assigns @ivar = param, update ivar type from param type
1320313203 i = 0
1320413204 while i < @cls_names.length
13205- mnames = @cls_meth_names[i].split(";")
13205+ mnames = @cls_meth_names[i].split(";", -1)
1320613206 mi = 0
1320713207 while mi < mnames.length
1320813208 init_idx = mi
1320913209 pnames = cls_meth_pnames_get(i, init_idx)
1321013210 ptypes = cls_meth_ptypes_get(i, init_idx)
13211- bodies = @cls_meth_bodies[i].split(";")
13211+ bodies = @cls_meth_bodies[i].split(";", -1)
1321213212 bid = -1
1321313213 if init_idx < bodies.length
1321413214 bid = bodies[init_idx].to_i
@@ -13228,8 +13228,8 @@
1322813228 if pi < ptypes.length
1322913229 # Update ivar type
1323013230 iname = @nd_name[sid]
13231- ivar_names = @cls_ivar_names[i].split(";")
13232- ivar_types = @cls_ivar_types[i].split(";")
13231+ ivar_names = @cls_ivar_names[i].split(";", -1)
13232+ ivar_types = @cls_ivar_types[i].split(";", -1)
1323313233 ij = 0
1323413234 while ij < ivar_names.length
1323513235 if ij < ivar_types.length
@@ -13271,8 +13271,8 @@
1327113271 # Check all classes' methods (not just the class owning the readers).
1327213272 oci = 0
1327313273 while oci < @cls_names.length
13274- mnames = @cls_meth_names[oci].split(";")
13275- bodies = @cls_meth_bodies[oci].split(";")
13274+ mnames = @cls_meth_names[oci].split(";", -1)
13275+ bodies = @cls_meth_bodies[oci].split(";", -1)
1327613276 j = 0
1327713277 while j < mnames.length
1327813278 if mnames[j] != "initialize"
@@ -13293,7 +13293,7 @@
1329313293 # only one reader and ignoring later accesses
1329413294 # would pick a class that fails to satisfy the
1329513295 # full method set.
13296- called = "".split(",")
13296+ called = "".split(",", -1)
1329713297 collect_param_methods(bid, pnames[pk], called)
1329813298 if called.length > 0 && called_methods_only_on_container_builtins(called) == 0
1329913299 # Check the param's default expression first: if it's an
@@ -13308,7 +13308,7 @@
1330813308 if j < @cls_meth_defaults[oci].split("|", -1).length
1330913309 defs_str_cm = @cls_meth_defaults[oci].split("|", -1)[j]
1331013310 end
13311- defs_arr_cm = defs_str_cm.split(",")
13311+ defs_arr_cm = defs_str_cm.split(",", -1)
1331213312 if pk < defs_arr_cm.length
1331313313 def_id_cm = defs_arr_cm[pk].to_i
1331413314 if def_id_cm > 0
@@ -13364,13 +13364,13 @@
1336413364 while mi < @meth_names.length
1336513365 bid = @meth_body_ids[mi]
1336613366 if bid >= 0
13367- pnames = @meth_param_names[mi].split(",")
13368- ptypes = @meth_param_types[mi].split(",")
13367+ pnames = @meth_param_names[mi].split(",", -1)
13368+ ptypes = @meth_param_types[mi].split(",", -1)
1336913369 pk = 0
1337013370 while pk < pnames.length
1337113371 if pk < ptypes.length
1337213372 if ptypes[pk] == "int"
13373- called = "".split(",")
13373+ called = "".split(",", -1)
1337413374 collect_param_methods(bid, pnames[pk], called)
1337513375 if called.length > 0 && called_methods_only_on_container_builtins(called) == 0
1337613376 # Same precedence rule as the cls_meth side above: if the
@@ -13382,7 +13382,7 @@
1338213382 if mi < @meth_has_defaults.length
1338313383 defs_str_mp = @meth_has_defaults[mi]
1338413384 end
13385- defs_arr_mp = defs_str_mp.split(",")
13385+ defs_arr_mp = defs_str_mp.split(",", -1)
1338613386 if pk < defs_arr_mp.length
1338713387 def_id_mp = defs_arr_mp[pk].to_i
1338813388 if def_id_mp > 0
@@ -13475,13 +13475,13 @@
1347513475 while mi < @meth_names.length
1347613476 bid = @meth_body_ids[mi]
1347713477 if bid >= 0
13478- pnames = @meth_param_names[mi].split(",")
13479- ptypes = @meth_param_types[mi].split(",")
13478+ pnames = @meth_param_names[mi].split(",", -1)
13479+ ptypes = @meth_param_types[mi].split(",", -1)
1348013480 changed_top = 0
1348113481 pk = 0
1348213482 while pk < pnames.length
1348313483 if pk < ptypes.length && (ptypes[pk] == "int" || ptypes[pk] == "nil")
13484- called = "".split(",")
13484+ called = "".split(",", -1)
1348513485 collect_param_methods(bid, pnames[pk], called)
1348613486 sawa = 0
1348713487 kk = 0
@@ -13508,8 +13508,8 @@
1350813508 end
1350913509 ci = 0
1351013510 while ci < @cls_names.length
13511- mnames = @cls_meth_names[ci].split(";")
13512- bodies = @cls_meth_bodies[ci].split(";")
13511+ mnames = @cls_meth_names[ci].split(";", -1)
13512+ bodies = @cls_meth_bodies[ci].split(";", -1)
1351313513 cls_changed = 0
1351413514 mj = 0
1351513515 while mj < mnames.length
@@ -13525,7 +13525,7 @@
1352513525 pk = 0
1352613526 while pk < pnames_j.length
1352713527 if pk < ptypes_j.length && (ptypes_j[pk] == "int" || ptypes_j[pk] == "nil")
13528- called_c = "".split(",")
13528+ called_c = "".split(",", -1)
1352913529 collect_param_methods(bid_j, pnames_j[pk], called_c)
1353013530 sawc = 0
1353113531 kk = 0
@@ -13594,13 +13594,13 @@
1359413594 while mi < @meth_names.length
1359513595 bid = @meth_body_ids[mi]
1359613596 if bid >= 0
13597- pnames = @meth_param_names[mi].split(",")
13598- ptypes = @meth_param_types[mi].split(",")
13597+ pnames = @meth_param_names[mi].split(",", -1)
13598+ ptypes = @meth_param_types[mi].split(",", -1)
1359913599 changed_top = 0
1360013600 pk = 0
1360113601 while pk < pnames.length
1360213602 if pk < ptypes.length && (ptypes[pk] == "int" || ptypes[pk] == "nil")
13603- called = "".split(",")
13603+ called = "".split(",", -1)
1360413604 collect_param_methods(bid, pnames[pk], called)
1360513605 saw = 0
1360613606 kk = 0
@@ -13626,8 +13626,8 @@
1362613626 end
1362713627 ci = 0
1362813628 while ci < @cls_names.length
13629- mnames = @cls_meth_names[ci].split(";")
13630- bodies = @cls_meth_bodies[ci].split(";")
13629+ mnames = @cls_meth_names[ci].split(";", -1)
13630+ bodies = @cls_meth_bodies[ci].split(";", -1)
1363113631 cls_changed = 0
1363213632 mj = 0
1363313633 while mj < mnames.length
@@ -13643,7 +13643,7 @@
1364313643 pk = 0
1364413644 while pk < pnames_j.length
1364513645 if pk < ptypes_j.length && (ptypes_j[pk] == "int" || ptypes_j[pk] == "nil")
13646- called_c = "".split(",")
13646+ called_c = "".split(",", -1)
1364713647 collect_param_methods(bid_j, pnames_j[pk], called_c)
1364813648 sawc = 0
1364913649 kk = 0
@@ -13766,8 +13766,8 @@
1376613766 while mi < @meth_names.length
1376713767 bid = @meth_body_ids[mi]
1376813768 if bid >= 0
13769- pnames = @meth_param_names[mi].split(",")
13770- ptypes = @meth_param_types[mi].split(",")
13769+ pnames = @meth_param_names[mi].split(",", -1)
13770+ ptypes = @meth_param_types[mi].split(",", -1)
1377113771 changed_cs = 0
1377213772 # Derive the lexical scope from the method name itself —
1377313773 # `Db_cls_column_bool` → "Db" — so a bare sibling call like
@@ -13782,7 +13782,7 @@
1378213782 pk = 0
1378313783 while pk < pnames.length
1378413784 if pk < ptypes.length && ptypes[pk] == "int"
13785- obs = "".split(",")
13785+ obs = "".split(",", -1)
1378613786 collect_param_callee_slots(bid, pnames[pk], obs)
1378713787 agreed = ""
1378813788 disagree = 0
@@ -13818,7 +13818,7 @@
1381813818 # assign_form_pair's `into` widened to str_poly_hash via body
1381913819 # heterogeneous `into[k] = val` + `into[k] = {}` writes.
1382013820 if pk < ptypes.length && is_hash_type(ptypes[pk]) == 1 && ptypes[pk].include?("poly") == false
13821- obs_h = "".split(",")
13821+ obs_h = "".split(",", -1)
1382213822 collect_param_callee_slots(bid, pnames[pk], obs_h)
1382313823 cur_kt_h = hash_key_part(ptypes[pk])
1382413824 agreed_h = ""
@@ -13861,8 +13861,8 @@
1386113861 # @meth_* walk over each registered class's cmeth table.
1386213862 cci_cs = 0
1386313863 while cci_cs < @cls_names.length
13864- cmnames_cs = @cls_cmeth_names[cci_cs].split(";")
13865- cmbodies_cs = @cls_cmeth_bodies[cci_cs].split(";")
13864+ cmnames_cs = @cls_cmeth_names[cci_cs].split(";", -1)
13865+ cmbodies_cs = @cls_cmeth_bodies[cci_cs].split(";", -1)
1386613866 cls_changed_cs = 0
1386713867 cmj_cs = 0
1386813868 while cmj_cs < cmnames_cs.length
@@ -13879,7 +13879,7 @@
1387913879 pk_cs = 0
1388013880 while pk_cs < pnames_cm_cs.length
1388113881 if pk_cs < ptypes_cm_cs.length && ptypes_cm_cs[pk_cs] == "int"
13882- obs_cs = "".split(",")
13882+ obs_cs = "".split(",", -1)
1388313883 collect_param_callee_slots(bid_cm_cs, pnames_cm_cs[pk_cs], obs_cs)
1388413884 agreed_cs = ""
1388513885 disagree_cs = 0
@@ -13911,7 +13911,7 @@
1391113911 # slot is a poly variant of the same hash family, widen the
1391213912 # caller's param accordingly.
1391313913 if pk_cs < ptypes_cm_cs.length && is_hash_type(ptypes_cm_cs[pk_cs]) == 1 && ptypes_cm_cs[pk_cs].include?("poly") == false
13914- obs_ch = "".split(",")
13914+ obs_ch = "".split(",", -1)
1391513915 collect_param_callee_slots(bid_cm_cs, pnames_cm_cs[pk_cs], obs_ch)
1391613916 cur_kt_ch = hash_key_part(ptypes_cm_cs[pk_cs])
1391713917 agreed_ch = ""
@@ -13991,7 +13991,7 @@
1399113991 lvi = 0
1399213992 while lvi < sn_lv.length
1399313993 if lvi < st_lv.length && is_hash_type(st_lv[lvi]) == 1 && st_lv[lvi].include?("poly") == false
13994- obs_lv = "".split(",")
13994+ obs_lv = "".split(",", -1)
1399513995 collect_param_callee_slots(bid_lv, sn_lv[lvi], obs_lv)
1399613996 cur_kt_lv = hash_key_part(st_lv[lvi])
1399713997 agreed_lv = ""
@@ -14036,7 +14036,7 @@
1403614036 # entries, so the widening propagates on the next iteration.
1403714037 ci_lv = 0
1403814038 while ci_lv < @cls_names.length
14039- bodies_lv = @cls_meth_bodies[ci_lv].split(";")
14039+ bodies_lv = @cls_meth_bodies[ci_lv].split(";", -1)
1404014040 bj_lv = 0
1404114041 while bj_lv < bodies_lv.length
1404214042 bid_im = bodies_lv[bj_lv].to_i
@@ -14047,7 +14047,7 @@
1404714047 lvii = 0
1404814048 while lvii < sn_im.length
1404914049 if lvii < st_im.length && is_hash_type(st_im[lvii]) == 1 && st_im[lvii].include?("poly") == false
14050- obs_im = "".split(",")
14050+ obs_im = "".split(",", -1)
1405114051 collect_param_callee_slots(bid_im, sn_im[lvii], obs_im)
1405214052 cur_kt_im = hash_key_part(st_im[lvii])
1405314053 agreed_im = ""
@@ -14101,8 +14101,8 @@
1410114101 def callee_kwarg_slot_type(callee_name, kwarg_name)
1410214102 cmi = find_method_idx(callee_name)
1410314103 if cmi >= 0
14104- cpnames = @meth_param_names[cmi].split(",")
14105- cptypes = @meth_param_types[cmi].split(",")
14104+ cpnames = @meth_param_names[cmi].split(",", -1)
14105+ cptypes = @meth_param_types[cmi].split(",", -1)
1410614106 pi = 0
1410714107 while pi < cpnames.length
1410814108 if cpnames[pi] == kwarg_name && pi < cptypes.length
@@ -14115,8 +14115,8 @@
1411514115 synth = @current_lexical_scope + "_cls_" + callee_name
1411614116 smi = find_method_idx(synth)
1411714117 if smi >= 0
14118- spnames = @meth_param_names[smi].split(",")
14119- sptypes = @meth_param_types[smi].split(",")
14118+ spnames = @meth_param_names[smi].split(",", -1)
14119+ sptypes = @meth_param_types[smi].split(",", -1)
1412014120 pi = 0
1412114121 while pi < spnames.length
1412214122 if spnames[pi] == kwarg_name && pi < sptypes.length
@@ -14127,7 +14127,7 @@
1412714127 end
1412814128 sci = find_class_idx(@current_lexical_scope)
1412914129 if sci >= 0
14130- sc_cmnames = @cls_cmeth_names[sci].split(";")
14130+ sc_cmnames = @cls_cmeth_names[sci].split(";", -1)
1413114131 smj = 0
1413214132 while smj < sc_cmnames.length
1413314133 if sc_cmnames[smj] == callee_name
@@ -14211,8 +14211,8 @@
1421114211 while mi < @meth_names.length
1421214212 bid = @meth_body_ids[mi]
1421314213 if bid >= 0
14214- pnames = @meth_param_names[mi].split(",")
14215- ptypes = @meth_param_types[mi].split(",")
14214+ pnames = @meth_param_names[mi].split(",", -1)
14215+ ptypes = @meth_param_types[mi].split(",", -1)
1421614216 changed = 0
1421714217 saved_scope = @current_lexical_scope
1421814218 mname_ks = @meth_names[mi]
@@ -14223,7 +14223,7 @@
1422314223 pk = 0
1422414224 while pk < pnames.length
1422514225 if pk < ptypes.length && (ptypes[pk] == "int" || ptypes[pk] == "nil")
14226- obs = "".split(",")
14226+ obs = "".split(",", -1)
1422714227 collect_param_kwarg_passthroughs(bid, pnames[pk], obs)
1422814228 agreed = ""
1422914229 disagree = 0
@@ -14263,7 +14263,7 @@
1426314263 def callee_slot_type(callee_name, pos)
1426414264 cmi = find_method_idx(callee_name)
1426514265 if cmi >= 0
14266- cpts = @meth_param_types[cmi].split(",")
14266+ cpts = @meth_param_types[cmi].split(",", -1)
1426714267 if pos < cpts.length
1426814268 return cpts[pos]
1426914269 end
@@ -14273,7 +14273,7 @@
1427314273 synth = @current_lexical_scope + "_cls_" + callee_name
1427414274 smi = find_method_idx(synth)
1427514275 if smi >= 0
14276- spts = @meth_param_types[smi].split(",")
14276+ spts = @meth_param_types[smi].split(",", -1)
1427714277 if pos < spts.length
1427814278 return spts[pos]
1427914279 end
@@ -14284,7 +14284,7 @@
1428414284 # resolves here.
1428514285 sci = find_class_idx(@current_lexical_scope)
1428614286 if sci >= 0
14287- sc_cmnames = @cls_cmeth_names[sci].split(";")
14287+ sc_cmnames = @cls_cmeth_names[sci].split(";", -1)
1428814288 smj = 0
1428914289 while smj < sc_cmnames.length
1429014290 if sc_cmnames[smj] == callee_name
@@ -14305,13 +14305,13 @@
1430514305 while mi < @meth_names.length
1430614306 bid = @meth_body_ids[mi]
1430714307 if bid >= 0
14308- pnames = @meth_param_names[mi].split(",")
14309- ptypes = @meth_param_types[mi].split(",")
14308+ pnames = @meth_param_names[mi].split(",", -1)
14309+ ptypes = @meth_param_types[mi].split(",", -1)
1431014310 changed_top = 0
1431114311 pk = 0
1431214312 while pk < pnames.length
1431314313 if pk < ptypes.length && ptypes[pk] == "int"
14314- called = "".split(",")
14314+ called = "".split(",", -1)
1431514315 collect_param_methods(bid, pnames[pk], called)
1431614316 sawk = 0
1431714317 kk = 0
@@ -14336,8 +14336,8 @@
1433614336 end
1433714337 ci = 0
1433814338 while ci < @cls_names.length
14339- mnames = @cls_meth_names[ci].split(";")
14340- bodies = @cls_meth_bodies[ci].split(";")
14339+ mnames = @cls_meth_names[ci].split(";", -1)
14340+ bodies = @cls_meth_bodies[ci].split(";", -1)
1434114341 cls_changed = 0
1434214342 mj = 0
1434314343 while mj < mnames.length
@@ -14353,7 +14353,7 @@
1435314353 pk = 0
1435414354 while pk < pnames_j.length
1435514355 if pk < ptypes_j.length && ptypes_j[pk] == "int"
14356- called_c = "".split(",")
14356+ called_c = "".split(",", -1)
1435714357 collect_param_methods(bid_j, pnames_j[pk], called_c)
1435814358 sawc = 0
1435914359 kk = 0
@@ -14501,7 +14501,7 @@
1450114501 if defaults_str == ""
1450214502 return 0
1450314503 end
14504- defs = defaults_str.split(",")
14504+ defs = defaults_str.split(",", -1)
1450514505 if pi >= defs.length
1450614506 return 0
1450714507 end
@@ -14534,8 +14534,8 @@
1453414534 while mi < @meth_names.length
1453514535 bid = @meth_body_ids[mi]
1453614536 if bid >= 0
14537- pnames = @meth_param_names[mi].split(",")
14538- ptypes = @meth_param_types[mi].split(",")
14537+ pnames = @meth_param_names[mi].split(",", -1)
14538+ ptypes = @meth_param_types[mi].split(",", -1)
1453914539 defaults_str_m = @meth_has_defaults[mi]
1454014540 changed_m = 0
1454114541 pk = 0
@@ -14564,8 +14564,8 @@
1456414564 end
1456514565 ci = 0
1456614566 while ci < @cls_names.length
14567- mnames = @cls_meth_names[ci].split(";")
14568- bodies = @cls_meth_bodies[ci].split(";")
14567+ mnames = @cls_meth_names[ci].split(";", -1)
14568+ bodies = @cls_meth_bodies[ci].split(";", -1)
1456914569 defaults_per = @cls_meth_defaults[ci].split("|", -1)
1457014570 cls_changed = 0
1457114571 mj = 0
@@ -14730,8 +14730,8 @@
1473014730 def widen_params_from_ivar_hash_aset
1473114731 ci = 0
1473214732 while ci < @cls_names.length
14733- mnames = @cls_meth_names[ci].split(";")
14734- bodies = @cls_meth_bodies[ci].split(";")
14733+ mnames = @cls_meth_names[ci].split(";", -1)
14734+ bodies = @cls_meth_bodies[ci].split(";", -1)
1473514735 cls_changed = 0
1473614736 mj = 0
1473714737 while mj < mnames.length
@@ -14742,8 +14742,8 @@
1474214742 bid_j = bodies[mj].to_i
1474314743 end
1474414744 if bid_j >= 0 && bid_j != -2 && pnames_j.length > 0
14745- key_widen = "".split(",")
14746- val_widen = "".split(",")
14745+ key_widen = "".split(",", -1)
14746+ val_widen = "".split(",", -1)
1474714747 while key_widen.length < pnames_j.length
1474814748 key_widen.push("")
1474914749 val_widen.push("")
@@ -14814,8 +14814,8 @@
1481414814 while mi < @meth_names.length
1481514815 bid = @meth_body_ids[mi]
1481614816 if bid >= 0
14817- pnames = @meth_param_names[mi].split(",")
14818- ptypes = @meth_param_types[mi].split(",")
14817+ pnames = @meth_param_names[mi].split(",", -1)
14818+ ptypes = @meth_param_types[mi].split(",", -1)
1481914819 ptypes_changed = 0
1482014820 # Set up the method's scope so scan_param_body_write_unify's
1482114821 # LV-read arm (used by is_reliable_literal_for_widen) can look
@@ -14854,18 +14854,18 @@
1485414854 # Per-class instance and class methods.
1485514855 ci = 0
1485614856 while ci < @cls_names.length
14857- mnames = @cls_meth_names[ci].split(";")
14857+ mnames = @cls_meth_names[ci].split(";", -1)
1485814858 all_params = @cls_meth_params[ci].split("|", -1)
1485914859 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
14860- bodies = @cls_meth_bodies[ci].split(";")
14860+ bodies = @cls_meth_bodies[ci].split(";", -1)
1486114861 cls_changed = 0
1486214862 mj = 0
1486314863 while mj < mnames.length
1486414864 if mj < all_params.length && mj < all_ptypes.length && mj < bodies.length
1486514865 bid_j = bodies[mj].to_i
1486614866 if bid_j >= 0
14867- pnames_j = all_params[mj].split(",")
14868- ptypes_j = all_ptypes[mj].split(",")
14867+ pnames_j = all_params[mj].split(",", -1)
14868+ ptypes_j = all_ptypes[mj].split(",", -1)
1486914869 inner_changed = 0
1487014870 # Same scope setup as the top-level branch so the LV-read
1487114871 # widening picks up sibling-param types.
@@ -14893,7 +14893,7 @@
1489314893 # observed as the RHS-is-pname target, and promote to
1489414894 # "poly" when found.
1489514895 if new_t != "poly" && mnames[mj] == "[]="
14896- ivt_set = "".split(",")
14896+ ivt_set = "".split(",", -1)
1489714897 collect_param_ivar_write_slot_types(bid_j, pnames_j[pk], ci, ivt_set)
1489814898 if ivt_set.length >= 2
1489914899 new_t = "poly"
@@ -14939,9 +14939,9 @@
1493914939 def widen_uninit_attr_ivars_to_poly
1494014940 ci = 0
1494114941 while ci < @cls_names.length
14942- readers = @cls_attr_readers[ci].split(";")
14943- writers = @cls_attr_writers[ci].split(";")
14944- attr_iname_set = "".split(",")
14942+ readers = @cls_attr_readers[ci].split(";", -1)
14943+ writers = @cls_attr_writers[ci].split(";", -1)
14944+ attr_iname_set = "".split(",", -1)
1494514945 k = 0
1494614946 while k < readers.length
1494714947 if readers[k] != "" && not_in("@" + readers[k], attr_iname_set) == 1
@@ -14960,8 +14960,8 @@
1496014960 ci = ci + 1
1496114961 next
1496214962 end
14963- names = @cls_ivar_names[ci].split(";")
14964- types = @cls_ivar_types[ci].split(";")
14963+ names = @cls_ivar_names[ci].split(";", -1)
14964+ types = @cls_ivar_types[ci].split(";", -1)
1496514965 changed_c = 0
1496614966 k = 0
1496714967 while k < names.length
@@ -15011,10 +15011,10 @@
1501115011 # widening to poly would break the body's `@amp -= int` arithmetic.
1501215012 def ivar_assigned_in_init_chain?(ci, iname)
1501315013 cur = ci
15014- visited = "".split(",")
15014+ visited = "".split(",", -1)
1501515015 while cur >= 0 && cur < @cls_names.length && not_in(@cls_names[cur], visited) == 1
1501615016 visited.push(@cls_names[cur])
15017- bodies_w = @cls_meth_bodies[cur].split(";")
15017+ bodies_w = @cls_meth_bodies[cur].split(";", -1)
1501815018 bi = 0
1501915019 while bi < bodies_w.length
1502015020 bid_w = bodies_w[bi].to_i
@@ -15027,8 +15027,8 @@
1502715027 end
1502815028 # `super` call anywhere in initialize delegates to the parent's
1502915029 # initialize path — assume that may assign any ancestor ivar.
15030- mnames_w = @cls_meth_names[cur].split(";")
15031- bodies_w2 = @cls_meth_bodies[cur].split(";")
15030+ mnames_w = @cls_meth_names[cur].split(";", -1)
15031+ bodies_w2 = @cls_meth_bodies[cur].split(";", -1)
1503215032 mi_init_w = 0
1503315033 while mi_init_w < mnames_w.length
1503415034 if mnames_w[mi_init_w] == "initialize" && mi_init_w < bodies_w2.length
@@ -15114,9 +15114,9 @@
1511415114 def widen_nil_default_params_to_poly
1511515115 mi = 0
1511615116 while mi < @meth_names.length
15117- pnames = @meth_param_names[mi].split(",")
15118- ptypes = @meth_param_types[mi].split(",")
15119- defaults = @meth_has_defaults[mi].split(",")
15117+ pnames = @meth_param_names[mi].split(",", -1)
15118+ ptypes = @meth_param_types[mi].split(",", -1)
15119+ defaults = @meth_has_defaults[mi].split(",", -1)
1512015120 changed = 0
1512115121 pk = 0
1512215122 while pk < pnames.length
@@ -15147,13 +15147,13 @@
1514715147 mj = 0
1514815148 while mj < all_params.length
1514915149 if mj < all_ptypes.length
15150- pnames_j = all_params[mj].split(",")
15151- ptypes_j = all_ptypes[mj].split(",")
15150+ pnames_j = all_params[mj].split(",", -1)
15151+ ptypes_j = all_ptypes[mj].split(",", -1)
1515215152 defs_str_j = ""
1515315153 if mj < all_defaults.length
1515415154 defs_str_j = all_defaults[mj]
1515515155 end
15156- defs_arr_j = defs_str_j.split(",")
15156+ defs_arr_j = defs_str_j.split(",", -1)
1515715157 inner_changed = 0
1515815158 pk = 0
1515915159 while pk < pnames_j.length
@@ -15188,13 +15188,13 @@
1518815188 cmj = 0
1518915189 while cmj < cmeth_params_all.length
1519015190 if cmj < cmeth_ptypes_all.length
15191- cm_pnames = cmeth_params_all[cmj].split(",")
15192- cm_ptypes = cmeth_ptypes_all[cmj].split(",")
15191+ cm_pnames = cmeth_params_all[cmj].split(",", -1)
15192+ cm_ptypes = cmeth_ptypes_all[cmj].split(",", -1)
1519315193 cm_defs_str = ""
1519415194 if cmj < cmeth_defaults_all.length
1519515195 cm_defs_str = cmeth_defaults_all[cmj]
1519615196 end
15197- cm_defs_arr = cm_defs_str.split(",")
15197+ cm_defs_arr = cm_defs_str.split(",", -1)
1519815198 cm_inner_changed = 0
1519915199 cpk = 0
1520015200 while cpk < cm_pnames.length
@@ -15270,7 +15270,7 @@
1527015270 # App.new internally) would need call-graph analysis and is left
1527115271 # to a follow-up.
1527215272 def detect_const_init_classes
15273- @const_init_class = "".split(",")
15273+ @const_init_class = "".split(",", -1)
1527415274 i = 0
1527515275 while i < @const_expr_ids.length
1527615276 cls_name_cic = ""
@@ -15384,7 +15384,7 @@
1538415384 def infer_yield_blk_param_types_for_body(body_id, ptypes_str)
1538515385 arity = body_max_yield_arity(body_id, 0)
1538615386 return "" if arity == 0 || body_id < 0
15387- types = "".split(",")
15387+ types = "".split(",", -1)
1538815388 k = 0
1538915389 while k < arity
1539015390 types.push("")
@@ -15401,12 +15401,12 @@
1540115401 # Locate the method's params (top-level or class-instance) so the
1540215402 # `yield <param>` shape resolves through find_var_type to the
1540315403 # (post-promote) param type instead of falling back to "int".
15404- pnames_arr = "".split(",")
15405- ptypes_arr = ptypes_str.split(",")
15404+ pnames_arr = "".split(",", -1)
15405+ ptypes_arr = ptypes_str.split(",", -1)
1540615406 mi_ll = 0
1540715407 while mi_ll < @meth_body_ids.length
1540815408 if @meth_body_ids[mi_ll] == body_id
15409- pnames_arr = @meth_param_names[mi_ll].split(",")
15409+ pnames_arr = @meth_param_names[mi_ll].split(",", -1)
1541015410 mi_ll = @meth_body_ids.length
1541115411 else
1541215412 mi_ll = mi_ll + 1
@@ -15415,7 +15415,7 @@
1541515415 if pnames_arr.length == 0
1541615416 ci_ll = 0
1541715417 while ci_ll < @cls_names.length
15418- bodies_ll = ci_ll < @cls_meth_bodies.length ? @cls_meth_bodies[ci_ll].split(";") : "".split(",")
15418+ bodies_ll = ci_ll < @cls_meth_bodies.length ? @cls_meth_bodies[ci_ll].split(";", -1) : "".split(",", -1)
1541915419 midx_ll = 0
1542015420 while midx_ll < bodies_ll.length
1542115421 if bodies_ll[midx_ll].to_i == body_id
@@ -15436,8 +15436,8 @@
1543615436 end
1543715437 j_p = j_p + 1
1543815438 end
15439- lnames = "".split(",")
15440- ltypes = "".split(",")
15439+ lnames = "".split(",", -1)
15440+ ltypes = "".split(",", -1)
1544115441 sn_b = @nd_scope_names[body_id]
1544215442 if sn_b != ""
1544315443 lnames = sn_b.split("|", -1)
@@ -15450,7 +15450,7 @@
1545015450 end
1545115451 project_yield_arg_types(body_id, types)
1545215452 pop_scope
15453- proj = "".split(",")
15453+ proj = "".split(",", -1)
1545415454 j = 0
1545515455 while j < types.length
1545615456 t = types[j]
@@ -15465,13 +15465,13 @@
1546515465 end
1546615466
1546715467 def infer_proc_blk_param_types
15468- @meth_blk_param_types = "".split(",")
15468+ @meth_blk_param_types = "".split(",", -1)
1546915469 mi = 0
1547015470 while mi < @meth_param_names.length
15471- types = @meth_param_types[mi].split(",")
15471+ types = @meth_param_types[mi].split(",", -1)
1547215472 if types.length > 0 && types.last == "proc"
15473- bpname = @meth_param_names[mi].split(",").last
15474- acc = "".split(",")
15473+ bpname = @meth_param_names[mi].split(",", -1).last
15474+ acc = "".split(",", -1)
1547515475 collect_blk_call_arg_types(@meth_body_ids[mi], bpname, acc, @meth_body_ids[mi])
1547615476 @meth_blk_param_types.push(acc.join("|"))
1547715477 elsif @meth_has_yield[mi] == 1
@@ -15485,21 +15485,21 @@
1548515485 end
1548615486 mi = mi + 1
1548715487 end
15488- @cls_cmeth_blk_param_types = "".split(",")
15488+ @cls_cmeth_blk_param_types = "".split(",", -1)
1548915489 ci = 0
1549015490 while ci < @cls_names.length
1549115491 if ci < @cls_cmeth_names.length
15492- cmnames = @cls_cmeth_names[ci].split(";")
15493- cm_bodies = @cls_cmeth_bodies[ci].split(";")
15492+ cmnames = @cls_cmeth_names[ci].split(";", -1)
15493+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
1549415494 cm_ptypes = @cls_cmeth_ptypes[ci].split("|", -1)
1549515495 cmidx = 0
1549615496 while cmidx < cmnames.length
1549715497 if cmidx < cm_ptypes.length
15498- cpts = cm_ptypes[cmidx].split(",")
15498+ cpts = cm_ptypes[cmidx].split(",", -1)
1549915499 if cpts.length > 0 && cpts.last == "proc"
1550015500 cpnames = cls_cmeth_pnames_get(ci, cmidx)
1550115501 bpname = cpnames[cpnames.length - 1]
15502- acc = "".split(",")
15502+ acc = "".split(",", -1)
1550315503 body_id = cm_bodies[cmidx].to_i
1550415504 collect_blk_call_arg_types(body_id, bpname, acc, body_id)
1550515505 @cls_cmeth_blk_param_types.push(acc.join("|"))
@@ -15920,8 +15920,8 @@
1592015920 while mi < @meth_names.length
1592115921 bid = @meth_body_ids[mi]
1592215922 if bid >= 0
15923- pnames = @meth_param_names[mi].split(",")
15924- ptypes = @meth_param_types[mi].split(",")
15923+ pnames = @meth_param_names[mi].split(",", -1)
15924+ ptypes = @meth_param_types[mi].split(",", -1)
1592515925 changed_top = 0
1592615926 pk = 0
1592715927 while pk < pnames.length
@@ -15958,8 +15958,8 @@
1595815958 end
1595915959 ci = 0
1596015960 while ci < @cls_names.length
15961- mnames = @cls_meth_names[ci].split(";")
15962- bodies = @cls_meth_bodies[ci].split(";")
15961+ mnames = @cls_meth_names[ci].split(";", -1)
15962+ bodies = @cls_meth_bodies[ci].split(";", -1)
1596315963 cls_changed = 0
1596415964 mj = 0
1596515965 while mj < mnames.length
@@ -16208,13 +16208,13 @@
1620816208 while mi < @meth_names.length
1620916209 bid = @meth_body_ids[mi]
1621016210 if bid >= 0
16211- pnames = @meth_param_names[mi].split(",")
16212- ptypes = @meth_param_types[mi].split(",")
16211+ pnames = @meth_param_names[mi].split(",", -1)
16212+ ptypes = @meth_param_types[mi].split(",", -1)
1621316213 empty_str = ""
1621416214 if mi < @meth_param_empty.length
1621516215 empty_str = @meth_param_empty[mi]
1621616216 end
16217- empties = empty_str.split(",")
16217+ empties = empty_str.split(",", -1)
1621816218 push_scope
1621916219 dj = 0
1622016220 while dj < pnames.length
@@ -16225,8 +16225,8 @@
1622516225 declare_var(pnames[dj], pt)
1622616226 dj = dj + 1
1622716227 end
16228- ml = "".split(",")
16229- mt = "".split(",")
16228+ ml = "".split(",", -1)
16229+ mt = "".split(",", -1)
1623016230 scan_locals(bid, ml, mt, pnames)
1623116231 lk = 0
1623216232 while lk < ml.length
@@ -16238,7 +16238,7 @@
1623816238 while pk < pnames.length
1623916239 if pk < ptypes.length && pk < empties.length
1624016240 if empties[pk] == "1" && ptypes[pk] == "int_array"
16241- elem_acc = "".split(",")
16241+ elem_acc = "".split(",", -1)
1624216242 collect_param_push_elem_types(bid, pnames[pk], elem_acc)
1624316243 promoted_type = empty_array_promotion_for(elem_acc)
1624416244 if promoted_type != ""
@@ -16271,7 +16271,7 @@
1627116271 all_params = @cls_meth_params[ci].split("|", -1)
1627216272 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
1627316273 all_empty = @cls_meth_ptypes_empty[ci].split("|", -1)
16274- bodies = @cls_meth_bodies[ci].split(";")
16274+ bodies = @cls_meth_bodies[ci].split(";", -1)
1627516275 cls_changed = 0
1627616276 mj = 0
1627716277 while mj < all_params.length
@@ -16280,14 +16280,14 @@
1628016280 bid = bodies[mj].to_i
1628116281 end
1628216282 if bid >= 0
16283- cm_pnames = all_params[mj].split(",")
16284- cm_ptypes = "".split(",")
16285- cm_empties = "".split(",")
16283+ cm_pnames = all_params[mj].split(",", -1)
16284+ cm_ptypes = "".split(",", -1)
16285+ cm_empties = "".split(",", -1)
1628616286 if mj < all_ptypes.length
16287- cm_ptypes = all_ptypes[mj].split(",")
16287+ cm_ptypes = all_ptypes[mj].split(",", -1)
1628816288 end
1628916289 if mj < all_empty.length
16290- cm_empties = all_empty[mj].split(",")
16290+ cm_empties = all_empty[mj].split(",", -1)
1629116291 end
1629216292 push_scope
1629316293 cdj = 0
@@ -16299,8 +16299,8 @@
1629916299 declare_var(cm_pnames[cdj], cpt)
1630016300 cdj = cdj + 1
1630116301 end
16302- cml = "".split(",")
16303- cmt = "".split(",")
16302+ cml = "".split(",", -1)
16303+ cmt = "".split(",", -1)
1630416304 scan_locals(bid, cml, cmt, cm_pnames)
1630516305 cmlk = 0
1630616306 while cmlk < cml.length
@@ -16312,7 +16312,7 @@
1631216312 while pk < cm_pnames.length
1631316313 if pk < cm_ptypes.length && pk < cm_empties.length
1631416314 if cm_empties[pk] == "1" && cm_ptypes[pk] == "int_array"
16315- elem_acc = "".split(",")
16315+ elem_acc = "".split(",", -1)
1631616316 collect_param_push_elem_types(bid, cm_pnames[pk], elem_acc)
1631716317 promoted_type = empty_array_promotion_for(elem_acc)
1631816318 if promoted_type != ""
@@ -16381,9 +16381,9 @@
1638116381 while mi < @meth_names.length
1638216382 bid = @meth_body_ids[mi]
1638316383 if bid >= 0
16384- pnames = @meth_param_names[mi].split(",")
16385- ptypes = @meth_param_types[mi].split(",")
16386- observations = "".split(",")
16384+ pnames = @meth_param_names[mi].split(",", -1)
16385+ ptypes = @meth_param_types[mi].split(",", -1)
16386+ observations = "".split(",", -1)
1638716387 collect_param_method_calls(bid, pnames, observations)
1638816388 changed = 0
1638916389 pk = 0
@@ -16408,7 +16408,7 @@
1640816408 while ci < @cls_names.length
1640916409 all_params = @cls_meth_params[ci].split("|", -1)
1641016410 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
16411- bodies = @cls_meth_bodies[ci].split(";")
16411+ bodies = @cls_meth_bodies[ci].split(";", -1)
1641216412 cls_changed = 0
1641316413 mj = 0
1641416414 while mj < all_params.length
@@ -16417,12 +16417,12 @@
1641716417 bid = bodies[mj].to_i
1641816418 end
1641916419 if bid >= 0
16420- cm_pnames = all_params[mj].split(",")
16421- cm_ptypes = "".split(",")
16420+ cm_pnames = all_params[mj].split(",", -1)
16421+ cm_ptypes = "".split(",", -1)
1642216422 if mj < all_ptypes.length
16423- cm_ptypes = all_ptypes[mj].split(",")
16423+ cm_ptypes = all_ptypes[mj].split(",", -1)
1642416424 end
16425- observations = "".split(",")
16425+ observations = "".split(",", -1)
1642616426 collect_param_method_calls(bid, cm_pnames, observations)
1642716427 m_changed = 0
1642816428 pk = 0
@@ -16673,18 +16673,18 @@
1667316673 # Does class `ci` define `mname` directly — instance method, attr
1667416674 # reader, or attr writer — without walking the parent chain?
1667516675 def class_has_method_local(ci, mname)
16676- readers = @cls_attr_readers[ci].split(";")
16676+ readers = @cls_attr_readers[ci].split(";", -1)
1667716677 if not_in(mname, readers) == 0
1667816678 return 1
1667916679 end
1668016680 if mname.length > 1 && mname[mname.length - 1] == "="
1668116681 bname = mname[0, mname.length - 1]
16682- writers = @cls_attr_writers[ci].split(";")
16682+ writers = @cls_attr_writers[ci].split(";", -1)
1668316683 if not_in(bname, writers) == 0
1668416684 return 1
1668516685 end
1668616686 end
16687- mnames = @cls_meth_names[ci].split(";")
16687+ mnames = @cls_meth_names[ci].split(";", -1)
1668816688 if not_in(mname, mnames) == 0
1668916689 return 1
1669016690 end
@@ -16739,7 +16739,7 @@
1673916739 # Cheap guard: the user must define a class with this method.
1674016740 ci2 = 0
1674116741 while ci2 < @cls_names.length
16742- mns = @cls_meth_names[ci2].split(";")
16742+ mns = @cls_meth_names[ci2].split(";", -1)
1674316743 jj = 0
1674416744 while jj < mns.length
1674516745 if mns[jj] == mname
@@ -16870,9 +16870,9 @@
1687016870 # Set up main scope for type inference
1687116871 push_scope
1687216872 stmts = get_body_stmts(@root_id)
16873- lnames = "".split(",")
16874- ltypes = "".split(",")
16875- empty_p = "".split(",")
16873+ lnames = "".split(",", -1)
16874+ ltypes = "".split(",", -1)
16875+ empty_p = "".split(",", -1)
1687616876 stmts.each { |sid|
1687716877 if @nd_type[sid] != "DefNode"
1687816878 if @nd_type[sid] != "ClassNode"
@@ -16901,8 +16901,8 @@
1690116901 # recorded type.
1690216902 saved_meth = @current_method_name
1690316903 @current_method_name = @meth_names[i]
16904- pnames = @meth_param_names[i].split(",")
16905- ptypes = @meth_param_types[i].split(",")
16904+ pnames = @meth_param_names[i].split(",", -1)
16905+ ptypes = @meth_param_types[i].split(",", -1)
1690616906 j = 0
1690716907 while j < pnames.length
1690816908 pt = "int"
@@ -16913,8 +16913,8 @@
1691316913 j = j + 1
1691416914 end
1691516915 if @meth_body_ids[i] >= 0
16916- ml = "".split(",")
16917- mt = "".split(",")
16916+ ml = "".split(",", -1)
16917+ mt = "".split(",", -1)
1691816918
1691916919 scan_locals(@meth_body_ids[i], ml, mt, pnames)
1692016920 lk = 0
@@ -16934,8 +16934,8 @@
1693416934 ci = 0
1693516935 while ci < @cls_names.length
1693616936 @current_class_idx = ci
16937- bodies = @cls_meth_bodies[ci].split(";")
16938- mnames = @cls_meth_names[ci].split(";")
16937+ bodies = @cls_meth_bodies[ci].split(";", -1)
16938+ mnames = @cls_meth_names[ci].split(";", -1)
1693916939 bj = 0
1694016940 while bj < bodies.length
1694116941 bid = bodies[bj].to_i
@@ -16952,8 +16952,8 @@
1695216952 declare_var(pnames2[pk], pt)
1695316953 pk = pk + 1
1695416954 end
16955- ml2 = "".split(",")
16956- mt2 = "".split(",")
16955+ ml2 = "".split(",", -1)
16956+ mt2 = "".split(",", -1)
1695716957 scan_locals(bid, ml2, mt2, pnames2)
1695816958 lk2 = 0
1695916959 while lk2 < ml2.length
@@ -16970,8 +16970,8 @@
1697016970 # Also scan class method bodies (def self.<m>) so an
1697116971 # attr_writer call on a freshly-`new`'d instance inside a
1697216972 # `def self.from_raw(...)` factory widens the ivar's type.
16973- cm_bodies = @cls_cmeth_bodies[ci].split(";")
16974- cm_names = @cls_cmeth_names[ci].split(";")
16973+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
16974+ cm_names = @cls_cmeth_names[ci].split(";", -1)
1697516975 saved_meth = @current_method_name
1697616976 cbj = 0
1697716977 while cbj < cm_bodies.length
@@ -16995,8 +16995,8 @@
1699516995 declare_var(cpnames[cpk], cpt)
1699616996 cpk = cpk + 1
1699716997 end
16998- cml = "".split(",")
16999- cmt = "".split(",")
16998+ cml = "".split(",", -1)
16999+ cmt = "".split(",", -1)
1700017000 scan_locals(cbid, cml, cmt, cpnames)
1700117001 clk = 0
1700217002 while clk < cml.length
@@ -17037,7 +17037,7 @@
1703717037 # ivar to poly just because Pass 1 recorded the bare name and a
1703817038 # later pass recorded the qualified one.
1703917039 def drop_stale_unqualified_obj_obs(obs)
17040- out = "".split(",")
17040+ out = "".split(",", -1)
1704117041 # Type-prime locals as strings so spinel-self-compile picks the
1704217042 # right C type (sp_str_sub_range / sp_str_concat returns
1704317043 # `const char *`; without the empty-string seed scan_locals
@@ -17088,14 +17088,14 @@
1708817088 def finalize_ivar_heterogeneity
1708917089 ci = 0
1709017090 while ci < @cls_names.length
17091- names = @cls_ivar_names[ci].split(";")
17092- types = @cls_ivar_types[ci].split(";")
17091+ names = @cls_ivar_names[ci].split(";", -1)
17092+ types = @cls_ivar_types[ci].split(";", -1)
1709317093 obs = @cls_ivar_observed_types[ci].split(";", -1)
1709417094 changed = 0
1709517095 ivk = 0
1709617096 while ivk < names.length
1709717097 if ivk < types.length && ivk < obs.length && types[ivk] != "poly"
17098- distinct = obs[ivk].split(",")
17098+ distinct = obs[ivk].split(",", -1)
1709917099 # Collapse stale unqualified obj-name observations against
1710017100 # their qualified form before the distinct-count widening
1710117101 # decision. A first-pass `@x = Foo.new(...)` recorded inside
@@ -17117,7 +17117,7 @@
1711717117 # Without this, callers that read the slot through an attr_
1711817118 # reader then forward into another method's typed param see a
1711917119 # poly value and degrade every downstream slot.
17120- collapsed = "".split(",")
17120+ collapsed = "".split(",", -1)
1712117121 ck = 0
1712217122 while ck < distinct.length
1712317123 cur = distinct[ck]
@@ -17211,7 +17211,7 @@
1721117211 if midx < 0
1721217212 return ""
1721317213 end
17214- bodies = @cls_meth_bodies[ci].split(";")
17214+ bodies = @cls_meth_bodies[ci].split(";", -1)
1721517215 if midx >= bodies.length
1721617216 return ""
1721717217 end
@@ -17250,7 +17250,7 @@
1725017250 # CallNode rhs (`@a = @b = make_int`) bypasses scan_ivars's
1725117251 # dual-definite-literal widening and tail slots stay at
1725217252 # their pre-existing concrete type.
17253- chain_inames = "".split(",")
17253+ chain_inames = "".split(",", -1)
1725417254 chain_inames.push(iname)
1725517255 bottom = expr_id
1725617256 while bottom >= 0 && @nd_type[bottom] == "InstanceVariableWriteNode"
@@ -17275,7 +17275,7 @@
1727517275 # the promoted type before recording.
1727617276 if at == "int_array" && @cur_writer_body >= 0 && @nd_type[bottom] == "LocalVariableReadNode"
1727717277 lname_a = @nd_name[bottom]
17278- elem_acc_a = "".split(",")
17278+ elem_acc_a = "".split(",", -1)
1727917279 collect_param_push_elem_types(@cur_writer_body, lname_a, elem_acc_a)
1728017280 promoted_a = empty_array_promotion_for(elem_acc_a)
1728117281 if promoted_a != ""
@@ -17431,7 +17431,7 @@
1743117431 cname = rt[4, rt.length - 4]
1743217432 ci = find_class_idx(cname)
1743317433 if ci >= 0
17434- writers = @cls_attr_writers[ci].split(";")
17434+ writers = @cls_attr_writers[ci].split(";", -1)
1743517435 wk = 0
1743617436 while wk < writers.length
1743717437 if writers[wk] == bname
@@ -17480,9 +17480,9 @@
1748017480 # poly across the program. Issue #684.
1748117481 obs_ids_pw = observed_class_ids_for_recv(@nd_receiver[nid], @current_class_idx)
1748217482 obs_filter_pw = (obs_ids_pw != "")
17483- obs_list_pw = "".split(",")
17483+ obs_list_pw = "".split(",", -1)
1748417484 if obs_filter_pw
17485- obs_list_pw = obs_ids_pw.split(",")
17485+ obs_list_pw = obs_ids_pw.split(",", -1)
1748617486 end
1748717487 ci_p = 0
1748817488 while ci_p < @cls_names.length
@@ -17501,7 +17501,7 @@
1750117501 end
1750217502 end
1750317503 if skip_pw == 0
17504- writers_p = @cls_attr_writers[ci_p].split(";")
17504+ writers_p = @cls_attr_writers[ci_p].split(";", -1)
1750517505 wk_p = 0
1750617506 while wk_p < writers_p.length
1750717507 if writers_p[wk_p] == bname
@@ -17753,10 +17753,10 @@
1775317753 # For setter methods (def x=(v); @x = v; end), infer param type from ivar type
1775417754 ci = 0
1775517755 while ci < @cls_names.length
17756- mnames = @cls_meth_names[ci].split(";")
17756+ mnames = @cls_meth_names[ci].split(";", -1)
1775717757 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
17758- ivar_names = @cls_ivar_names[ci].split(";")
17759- ivar_types = @cls_ivar_types[ci].split(";")
17758+ ivar_names = @cls_ivar_names[ci].split(";", -1)
17759+ ivar_types = @cls_ivar_types[ci].split(";", -1)
1776017760 changed = 0
1776117761 j = 0
1776217762 bname = ""
@@ -17805,7 +17805,7 @@
1780517805 # or passed to functions that expect lambda args (transitive closure)
1780617806 changed = 1
1780717807 iter = 0
17808- sig_hist = "".split(",")
17808+ sig_hist = "".split(",", -1)
1780917809 while changed == 1
1781017810 iter = iter + 1
1781117811 if iter > 256
@@ -17817,8 +17817,8 @@
1781717817 while mi < @meth_names.length
1781817818 bid = @meth_body_ids[mi]
1781917819 if bid >= 0
17820- pnames = @meth_param_names[mi].split(",")
17821- ptypes = @meth_param_types[mi].split(",")
17820+ pnames = @meth_param_names[mi].split(",", -1)
17821+ ptypes = @meth_param_types[mi].split(",", -1)
1782217822 pk = 0
1782317823 while pk < pnames.length
1782417824 if pk < ptypes.length
@@ -17918,7 +17918,7 @@
1791817918 if recv < 0
1791917919 fmi = find_method_idx(mname)
1792017920 if fmi >= 0
17921- fptypes = @meth_param_types[fmi].split(",")
17921+ fptypes = @meth_param_types[fmi].split(",", -1)
1792217922 args_id = @nd_arguments[nid]
1792317923 if args_id >= 0
1792417924 aargs = get_args(args_id)
@@ -18033,7 +18033,7 @@
1803318033 args_id = @nd_arguments[nid]
1803418034 if args_id >= 0
1803518035 aargs = get_args(args_id)
18036- ptypes = @meth_param_types[mi].split(",")
18036+ ptypes = @meth_param_types[mi].split(",", -1)
1803718037 changed = 0
1803818038 k = 0
1803918039 while k < aargs.length
@@ -18137,18 +18137,18 @@
1813718137 # (raise-only bodies would otherwise re-derive as "int").
1813818138 def unify_imeth_override_returns
1813918139 if @unified_imeth_returns == nil
18140- @unified_imeth_returns = "".split(",")
18140+ @unified_imeth_returns = "".split(",", -1)
1814118141 end
1814218142 ci = 0
1814318143 while ci < @cls_names.length
18144- mnames = @cls_meth_names[ci].split(";")
18145- returns = @cls_meth_returns[ci].split(";")
18144+ mnames = @cls_meth_names[ci].split(";", -1)
18145+ returns = @cls_meth_returns[ci].split(";", -1)
1814618146 changed = 0
1814718147 mi = 0
1814818148 while mi < mnames.length
1814918149 mname = mnames[mi]
1815018150 if mname != ""
18151- types = "".split(",")
18151+ types = "".split(",", -1)
1815218152 base_ret = ""
1815318153 if mi < returns.length
1815418154 base_ret = returns[mi]
@@ -18160,7 +18160,7 @@
1816018160 if dci != ci && cls_is_descendant(dci, ci) == 1
1816118161 dmidx = cls_find_method_direct(dci, mname)
1816218162 if dmidx >= 0
18163- d_returns = @cls_meth_returns[dci].split(";")
18163+ d_returns = @cls_meth_returns[dci].split(";", -1)
1816418164 if dmidx < d_returns.length
1816518165 types.push(d_returns[dmidx])
1816618166 have_descendant_override = 1
@@ -18186,7 +18186,7 @@
1818618186 if dci2 != ci && cls_is_descendant(dci2, ci) == 1
1818718187 dmidx2 = cls_find_method_direct(dci2, mname)
1818818188 if dmidx2 >= 0
18189- d_returns2 = @cls_meth_returns[dci2].split(";")
18189+ d_returns2 = @cls_meth_returns[dci2].split(";", -1)
1819018190 if dmidx2 < d_returns2.length && d_returns2[dmidx2] != unified
1819118191 d_returns2[dmidx2] = unified
1819218192 @cls_meth_returns[dci2] = d_returns2.join(";")
@@ -18289,8 +18289,8 @@
1828918289 declare_var(pnames[k], pt)
1829018290 k = k + 1
1829118291 end
18292- lnames = "".split(",")
18293- ltypes = "".split(",")
18292+ lnames = "".split(",", -1)
18293+ ltypes = "".split(",", -1)
1829418294 refine_method_body_locals(bid, lnames, ltypes, pnames)
1829518295 need = method_returns_need_poly_widening(bid, declared_rt)
1829618296 pop_scope
@@ -18310,8 +18310,8 @@
1831018310 while mi < @meth_names.length
1831118311 bid = @meth_body_ids[mi]
1831218312 cur_rt = @meth_return_types[mi]
18313- pnames = @meth_param_names[mi].split(",")
18314- ptypes = @meth_param_types[mi].split(",")
18313+ pnames = @meth_param_names[mi].split(",", -1)
18314+ ptypes = @meth_param_types[mi].split(",", -1)
1831518315 saved_meth = @current_method_name
1831618316 @current_method_name = @meth_names[mi]
1831718317 if widen_check_with_scope(bid, cur_rt, pnames, ptypes) == 1
@@ -18326,9 +18326,9 @@
1832618326 while ci < @cls_names.length
1832718327 saved_ci = @current_class_idx
1832818328 @current_class_idx = ci
18329- bodies = @cls_meth_bodies[ci].split(";")
18330- mnames = @cls_meth_names[ci].split(";")
18331- returns = @cls_meth_returns[ci].split(";")
18329+ bodies = @cls_meth_bodies[ci].split(";", -1)
18330+ mnames = @cls_meth_names[ci].split(";", -1)
18331+ returns = @cls_meth_returns[ci].split(";", -1)
1833218332 changed = 0
1833318333 j = 0
1833418334 while j < bodies.length
@@ -18381,9 +18381,9 @@
1838118381 while ci < @cls_names.length
1838218382 saved_ci = @current_class_idx
1838318383 @current_class_idx = ci
18384- cbodies = @cls_cmeth_bodies[ci].split(";")
18385- cmnames = @cls_cmeth_names[ci].split(";")
18386- creturns = @cls_cmeth_returns[ci].split(";")
18384+ cbodies = @cls_cmeth_bodies[ci].split(";", -1)
18385+ cmnames = @cls_cmeth_names[ci].split(";", -1)
18386+ creturns = @cls_cmeth_returns[ci].split(";", -1)
1838718387 changed = 0
1838818388 j = 0
1838918389 while j < cbodies.length
@@ -18424,7 +18424,7 @@
1842418424 def unify_imeth_override_ptypes
1842518425 ci = 0
1842618426 while ci < @cls_names.length
18427- mnames = @cls_meth_names[ci].split(";")
18427+ mnames = @cls_meth_names[ci].split(";", -1)
1842818428 mi = 0
1842918429 while mi < mnames.length
1843018430 mname = mnames[mi]
@@ -18449,7 +18449,7 @@
1844918449 n = base_pt.length
1845018450 # Determine, per slot, whether at least one family member
1845118451 # has "poly". If so, widen every member at that slot.
18452- poly_slot = "".split(",")
18452+ poly_slot = "".split(",", -1)
1845318453 k = 0
1845418454 while k < n
1845518455 poly_slot.push("0")
@@ -18569,8 +18569,8 @@
1856918569 if mfn.start_with?("__oc_Float_")
1857018570 declare_var("__self_type", "float")
1857118571 end
18572- pnames = @meth_param_names[i].split(",")
18573- ptypes = @meth_param_types[i].split(",")
18572+ pnames = @meth_param_names[i].split(",", -1)
18573+ ptypes = @meth_param_types[i].split(",", -1)
1857418574 j = 0
1857518575 while j < pnames.length
1857618576 pt = "int"
@@ -18589,8 +18589,8 @@
1858918589 # time, after `infer_body_return` has already pinned the
1859018590 # function's return type at the unrefined value.
1859118591 if @meth_body_ids[i] >= 0
18592- lnames = "".split(",")
18593- ltypes = "".split(",")
18592+ lnames = "".split(",", -1)
18593+ ltypes = "".split(",", -1)
1859418594 refine_method_body_locals(@meth_body_ids[i], lnames, ltypes, pnames)
1859518595 end
1859618596 rt = infer_body_return(@meth_body_ids[i])
@@ -18614,23 +18614,23 @@
1861418614 i = 0
1861518615 while i < @cls_names.length
1861618616 @current_class_idx = i
18617- mnames = @cls_meth_names[i].split(";")
18617+ mnames = @cls_meth_names[i].split(";", -1)
1861818618 all_params = @cls_meth_params[i].split("|", -1)
1861918619 all_ptypes = @cls_meth_ptypes[i].split("|", -1)
18620- bodies = @cls_meth_bodies[i].split(";")
18621- returns = @cls_meth_returns[i].split(";")
18620+ bodies = @cls_meth_bodies[i].split(";", -1)
18621+ returns = @cls_meth_returns[i].split(";", -1)
1862218622
1862318623 j = 0
1862418624 while j < mnames.length
1862518625 push_scope
18626- pnames = "".split(",")
18627- ptypes = "".split(",")
18626+ pnames = "".split(",", -1)
18627+ ptypes = "".split(",", -1)
1862818628
1862918629 if j < all_params.length
18630- pnames = all_params[j].split(",")
18630+ pnames = all_params[j].split(",", -1)
1863118631 end
1863218632 if j < all_ptypes.length
18633- ptypes = all_ptypes[j].split(",")
18633+ ptypes = all_ptypes[j].split(",", -1)
1863418634 end
1863518635
1863618636 # Infer param types for initialize
@@ -18694,8 +18694,8 @@
1869418694 end
1869518695 # Declare locals for better return type inference
1869618696 if bid >= 0
18697- rlnames = "".split(",")
18698- rltypes = "".split(",")
18697+ rlnames = "".split(",", -1)
18698+ rltypes = "".split(",", -1)
1869918699 scan_locals(bid, rlnames, rltypes, pnames)
1870018700 rlk = 0
1870118701 while rlk < rlnames.length
@@ -18709,8 +18709,8 @@
1870918709 # encounters disagreeing concrete-literal writes; that's a
1871018710 # superset of scan_locals_first_type's "never-poly" rule but
1871118711 # produces strictly more accurate types for return inference.
18712- rlnames2 = "".split(",")
18713- rltypes2 = "".split(",")
18712+ rlnames2 = "".split(",", -1)
18713+ rltypes2 = "".split(",", -1)
1871418714 scan_locals(bid, rlnames2, rltypes2, pnames)
1871518715 rlk2 = 0
1871618716 while rlk2 < rlnames2.length
@@ -18780,9 +18780,9 @@
1878018780 # setup the instance-method side does so a `def self.<m>`
1878118781 # body's return type sees its locals (instance = new etc.)
1878218782 # and bare `new` resolves via current_class_method_owning_class.
18783- cmnames = @cls_cmeth_names[i].split(";")
18784- cm_bodies = @cls_cmeth_bodies[i].split(";")
18785- cm_returns = @cls_cmeth_returns[i].split(";")
18783+ cmnames = @cls_cmeth_names[i].split(";", -1)
18784+ cm_bodies = @cls_cmeth_bodies[i].split(";", -1)
18785+ cm_returns = @cls_cmeth_returns[i].split(";", -1)
1878618786 cm_params = @cls_cmeth_params[i].split("|", -1)
1878718787 cm_ptypes = @cls_cmeth_ptypes[i].split("|", -1)
1878818788 saved_meth = @current_method_name
@@ -18794,13 +18794,13 @@
1879418794 bid = cm_bodies[j].to_i
1879518795 end
1879618796 @current_method_name = @cls_names[i] + "_cls_" + cmnames[j]
18797- cpnames = "".split(",")
18798- cptypes = "".split(",")
18797+ cpnames = "".split(",", -1)
18798+ cptypes = "".split(",", -1)
1879918799 if j < cm_params.length
18800- cpnames = cm_params[j].split(",")
18800+ cpnames = cm_params[j].split(",", -1)
1880118801 end
1880218802 if j < cm_ptypes.length
18803- cptypes = cm_ptypes[j].split(",")
18803+ cptypes = cm_ptypes[j].split(",", -1)
1880418804 end
1880518805 cpk = 0
1880618806 while cpk < cpnames.length
@@ -18820,8 +18820,8 @@
1882018820 # actually-emitted local is correctly typed `sp_<C> *`,
1882118821 # so the function signature and the body's `return`
1882218822 # statement disagree at the C boundary.
18823- ml = "".split(",")
18824- mt = "".split(",")
18823+ ml = "".split(",", -1)
18824+ mt = "".split(",", -1)
1882518825 refine_method_body_locals(bid, ml, mt, cpnames)
1882618826 end
1882718827 rt = infer_body_return(bid)
@@ -18873,7 +18873,7 @@
1887318873 # Top-level method variant of widen_nil_ptypes: reads/writes
1887418874 # @meth_param_types[i] directly.
1887518875 def widen_nil_defaults_to(table, i, rt)
18876- ptypes = table[i].split(",")
18876+ ptypes = table[i].split(",", -1)
1887718877 if widen_nil_ptypes(ptypes, rt) == 1
1887818878 table[i] = ptypes.join(",")
1887918879 end
@@ -18886,14 +18886,14 @@
1888618886 # has already propagated call-site-inferred types into ivars by this point.
1888718887 init_idx0 = cls_find_method_direct(ci, "initialize")
1888818888 if init_idx0 >= 0
18889- bodies0 = @cls_meth_bodies[ci].split(";")
18889+ bodies0 = @cls_meth_bodies[ci].split(";", -1)
1889018890 if init_idx0 < bodies0.length && bodies0[init_idx0].to_i == -2
1889118891 return cls_ivar_type(ci, "@" + pname)
1889218892 end
1889318893 end
1889418894 # Check if param is assigned to an ivar in initialize
18895- mnames = @cls_meth_names[ci].split(";")
18896- bodies = @cls_meth_bodies[ci].split(";")
18895+ mnames = @cls_meth_names[ci].split(";", -1)
18896+ bodies = @cls_meth_bodies[ci].split(";", -1)
1889718897 j = 0
1889818898 while j < mnames.length
1889918899 if mnames[j] == "initialize"
@@ -18931,7 +18931,7 @@
1893118931 if parent_init >= 0
1893218932 parent_ptypes = @cls_meth_ptypes[parent_ci].split("|", -1)
1893318933 if parent_init < parent_ptypes.length
18934- ppt = parent_ptypes[parent_init].split(",")
18934+ ppt = parent_ptypes[parent_init].split(",", -1)
1893518935 if sk < ppt.length
1893618936 return ppt[sk]
1893718937 end
@@ -18962,7 +18962,7 @@
1896218962 return "void"
1896318963 end
1896418964 # Collect all explicit return types
18965- types = "".split(",")
18965+ types = "".split(",", -1)
1896618966 collect_return_types_nid(body_id, types)
1896718967 # Push sibling-scope narrows from preceding guards so the
1896818968 # implicit-return type sees the narrowed local types. Without
@@ -18997,7 +18997,7 @@
1899718997 last_type = infer_type(last_id)
1899818998 if last_type == "int_array" && @nd_type[last_id] == "LocalVariableReadNode"
1899918999 lname_lr = @nd_name[last_id]
19000- elem_acc_lr = "".split(",")
19000+ elem_acc_lr = "".split(",", -1)
1900119001 collect_param_push_elem_types(body_id, lname_lr, elem_acc_lr)
1900219002 promoted_lr = empty_array_promotion_for(elem_acc_lr)
1900319003 if promoted_lr != ""
@@ -19165,7 +19165,7 @@
1916519165 # filtering out missing bodies (negative IDs). Used by both the
1916619166 # `infer_type` BeginNode arm (last-stmt type unification) and the
1916719167 # `collect_return_types` BeginNode arm (explicit-return walk).
19168- # `[]` (not `"".split(",")`) is the int_array init idiom in this
19168+ # `[]` (not `"".split(",", -1)`) is the int_array init idiom in this
1916919169 # codebase — see the @nd_* parallel arrays in `initialize`.
1917019170 def begin_node_arm_bodies(nid)
1917119171 out = []
@@ -19559,9 +19559,9 @@
1955919559 push_scope
1956019560 stmts = get_body_stmts(@root_id)
1956119561 pre_scan_simple_local_writes(stmts)
19562- lnames = "".split(",")
19563- ltypes = "".split(",")
19564- empty_p = "".split(",")
19562+ lnames = "".split(",", -1)
19563+ ltypes = "".split(",", -1)
19564+ empty_p = "".split(",", -1)
1956519565 stmts.each { |sid|
1956619566 if @nd_type[sid] != "DefNode"
1956719567 if @nd_type[sid] != "ClassNode"
@@ -20265,9 +20265,9 @@
2026520265 stmts = get_body_stmts(@root_id)
2026620266 # First, figure out main local types
2026720267 push_scope
20268- lnames = "".split(",")
20269- ltypes = "".split(",")
20270- empty_p = "".split(",")
20268+ lnames = "".split(",", -1)
20269+ ltypes = "".split(",", -1)
20270+ empty_p = "".split(",", -1)
2027120271 stmts.each { |sid|
2027220272 if @nd_type[sid] != "DefNode"
2027320273 if @nd_type[sid] != "ClassNode"
@@ -20300,8 +20300,8 @@
2030020300 # Check if it's a method parameter with a known type
2030120301 mi = 0
2030220302 while mi < @meth_names.length
20303- pnames = @meth_param_names[mi].split(",")
20304- ptypes = @meth_param_types[mi].split(",")
20303+ pnames = @meth_param_names[mi].split(",", -1)
20304+ ptypes = @meth_param_types[mi].split(",", -1)
2030520305 pi = 0
2030620306 while pi < pnames.length
2030720307 if pnames[pi] == vn && pi < ptypes.length
@@ -20320,7 +20320,7 @@
2032020320 ci = find_class_idx(cname)
2032120321 if ci >= 0
2032220322 mname = @nd_name[nid]
20323- readers = @cls_attr_readers[ci].split(";")
20323+ readers = @cls_attr_readers[ci].split(";", -1)
2032420324 rk = 0
2032520325 while rk < readers.length
2032620326 if readers[rk] == mname
@@ -20349,7 +20349,7 @@
2034920349 # Scan initialize body for @ivar = param assignments
2035020350 bj = cls_find_method_direct(ci, "initialize")
2035120351 if bj >= 0
20352- bodies = @cls_meth_bodies[ci].split(";")
20352+ bodies = @cls_meth_bodies[ci].split(";", -1)
2035320353 bid = bj < bodies.length ? bodies[bj].to_i : -1
2035420354 if bid >= 0
2035520355 pnames = cls_meth_pnames_get(ci, bj)
@@ -20420,7 +20420,7 @@
2042020420 args_id = @nd_arguments[nid]
2042120421 if args_id >= 0
2042220422 arg_ids = get_args(args_id)
20423- ptypes = @meth_param_types[mi].split(",")
20423+ ptypes = @meth_param_types[mi].split(",", -1)
2042420424 rest_param_idx = method_rest_index(mi)
2042520425 # Splat slot widening: a `def f(*args)` slot defaults to int_array
2042620426 # (the splat default in collect_ptypes_str). Every call site packs
@@ -20597,8 +20597,8 @@
2059720597 def detect_poly_locals
2059820598 # Detect local variables assigned different types in main scope
2059920599 stmts = get_body_stmts(@root_id)
20600- local_types = "".split(",")
20601- local_names = "".split(",")
20600+ local_types = "".split(",", -1)
20601+ local_names = "".split(",", -1)
2060220602 stmts.each { |sid|
2060320603 if @nd_type[sid] != "DefNode"
2060420604 if @nd_type[sid] != "ClassNode"
@@ -20695,8 +20695,8 @@
2069520695 # leaving the inner class's initialize ptypes un-widened.
2069620696 saved_method_name = @current_method_name
2069720697 @current_method_name = @meth_names[mi]
20698- pnames = @meth_param_names[mi].split(",")
20699- ptypes = @meth_param_types[mi].split(",")
20698+ pnames = @meth_param_names[mi].split(",", -1)
20699+ ptypes = @meth_param_types[mi].split(",", -1)
2070020700 pk = 0
2070120701 while pk < pnames.length
2070220702 if pnames[pk] != ""
@@ -20705,8 +20705,8 @@
2070520705 pk = pk + 1
2070620706 end
2070720707 # Scan locals in the body
20708- lnames = "".split(",")
20709- ltypes = "".split(",")
20708+ lnames = "".split(",", -1)
20709+ ltypes = "".split(",", -1)
2071020710 scan_locals(bid, lnames, ltypes, pnames)
2071120711 lk = 0
2071220712 while lk < lnames.length
@@ -20923,8 +20923,8 @@
2092320923 while pass < 5
2092420924 ci = 0
2092520925 while ci < @cls_names.length
20926- mnames = @cls_meth_names[ci].split(";")
20927- bodies = @cls_meth_bodies[ci].split(";")
20926+ mnames = @cls_meth_names[ci].split(";", -1)
20927+ bodies = @cls_meth_bodies[ci].split(";", -1)
2092820928 mi = 0
2092920929 while mi < mnames.length
2093020930 bid = -1
@@ -20949,8 +20949,8 @@
2094920949 pk = pk + 1
2095020950 end
2095120951 # Scan locals using first-type-only (no poly marking)
20952- lnames = "".split(",")
20953- ltypes = "".split(",")
20952+ lnames = "".split(",", -1)
20953+ ltypes = "".split(",", -1)
2095420954 scan_locals_first_type(bid, lnames, ltypes, pnames_arr)
2095520955 lk = 0
2095620956 while lk < lnames.length
@@ -20958,8 +20958,8 @@
2095820958 lk = lk + 1
2095920959 end
2096020960 # Second pass: rescan with locals now in scope for better inference
20961- lnames2 = "".split(",")
20962- ltypes2 = "".split(",")
20961+ lnames2 = "".split(",", -1)
20962+ ltypes2 = "".split(",", -1)
2096320963 scan_locals_first_type(bid, lnames2, ltypes2, pnames_arr)
2096420964 lk2 = 0
2096520965 while lk2 < lnames2.length
@@ -20981,8 +20981,8 @@
2098120981 # so a `params.fetch(:k, "")` call inside a `def
2098220982 # self.from_raw` widens P.fetch's default param via the
2098320983 # receiver-method unify path inside scan_new_calls.
20984- cm_names = @cls_cmeth_names[ci].split(";")
20985- cm_bodies = @cls_cmeth_bodies[ci].split(";")
20984+ cm_names = @cls_cmeth_names[ci].split(";", -1)
20985+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
2098620986 cm_params = @cls_cmeth_params[ci].split("|", -1)
2098720987 cm_ptypes = @cls_cmeth_ptypes[ci].split("|", -1)
2098820988 saved_meth_cb = @current_method_name
@@ -20996,13 +20996,13 @@
2099620996 @current_class_idx = ci
2099720997 @current_method_name = @cls_names[ci] + "_cls_" + cm_names[cmi]
2099820998 push_scope
20999- cpnames = "".split(",")
21000- cptypes = "".split(",")
20999+ cpnames = "".split(",", -1)
21000+ cptypes = "".split(",", -1)
2100121001 if cmi < cm_params.length
21002- cpnames = cm_params[cmi].split(",")
21002+ cpnames = cm_params[cmi].split(",", -1)
2100321003 end
2100421004 if cmi < cm_ptypes.length
21005- cptypes = cm_ptypes[cmi].split(",")
21005+ cptypes = cm_ptypes[cmi].split(",", -1)
2100621006 end
2100721007 cpk = 0
2100821008 while cpk < cpnames.length
@@ -21015,8 +21015,8 @@
2101521015 end
2101621016 cpk = cpk + 1
2101721017 end
21018- cml = "".split(",")
21019- cmt = "".split(",")
21018+ cml = "".split(",", -1)
21019+ cmt = "".split(",", -1)
2102021020 scan_locals_first_type(cbid, cml, cmt, cpnames)
2102121021 clk = 0
2102221022 while clk < cml.length
@@ -21211,9 +21211,9 @@
2121121211 ci = 0
2121221212 while ci < @cls_names.length
2121321213 cname = @cls_names[ci]
21214- writers = @cls_attr_writers[ci].split(";")
21215- names = @cls_ivar_names[ci].split(";")
21216- types = @cls_ivar_types[ci].split(";")
21214+ writers = @cls_attr_writers[ci].split(";", -1)
21215+ names = @cls_ivar_names[ci].split(";", -1)
21216+ types = @cls_ivar_types[ci].split(";", -1)
2121721217 changed = 0
2121821218 k = 0
2121921219 while k < names.length
@@ -21342,7 +21342,7 @@
2134221342 end
2134321343 ck = 0
2134421344 while ck < @cls_includes.length
21345- incs = @cls_includes[ck].split(";")
21345+ incs = @cls_includes[ck].split(";", -1)
2134621346 ik = 0
2134721347 while ik < incs.length
2134821348 if incs[ik] == current_cls_name
@@ -21426,9 +21426,9 @@
2142621426 ci = ci + 1
2142721427 next
2142821428 end
21429- names = @cls_ivar_names[ci].split(";")
21430- types = @cls_ivar_types[ci].split(";")
21431- defs = @cls_ivar_init_definite[ci].split(";")
21429+ names = @cls_ivar_names[ci].split(";", -1)
21430+ types = @cls_ivar_types[ci].split(";", -1)
21431+ defs = @cls_ivar_init_definite[ci].split(";", -1)
2143221432 # observed_types are the actual concrete types the inference
2143321433 # passes saw written into this slot, accumulated separately from
2143421434 # the running @cls_ivar_types (which apply_rbs_seeds may already
@@ -21449,7 +21449,7 @@
2144921449 definite = 1
2145021450 end
2145121451 if definite == 1 && k < obs_row.length && obs_row[k] != ""
21452- obs_list = obs_row[k].split(",")
21452+ obs_list = obs_row[k].split(",", -1)
2145321453 oi = 0
2145421454 while oi < obs_list.length
2145521455 ot = obs_list[oi]
@@ -21802,8 +21802,8 @@
2180221802 if ci >= ret_tbl.length
2180321803 return
2180421804 end
21805- rets = ret_tbl[ci].split(";")
21806- bodies = ci < body_tbl.length ? body_tbl[ci].split(";") : "".split(",")
21805+ rets = ret_tbl[ci].split(";", -1)
21806+ bodies = ci < body_tbl.length ? body_tbl[ci].split(";", -1) : "".split(",", -1)
2180721807 changed = 0
2180821808 mj = 0
2180921809 while mj < rets.length
@@ -21868,7 +21868,7 @@
2186821868 # Top-level methods.
2186921869 mi = 0
2187021870 while mi < @meth_param_types.length
21871- pt = @meth_param_types[mi].split(",")
21871+ pt = @meth_param_types[mi].split(",", -1)
2187221872 changed = 0
2187321873 pk = 0
2187421874 while pk < pt.length
@@ -21890,7 +21890,7 @@
2189021890 @meth_return_types[mi] = "bigint"
2189121891 @needs_bigint = 1
2189221892 elsif @meth_return_types[mi].start_with?("tuple:")
21893- tparts_mr = @meth_return_types[mi][6, @meth_return_types[mi].length - 6].split(",")
21893+ tparts_mr = @meth_return_types[mi][6, @meth_return_types[mi].length - 6].split(",", -1)
2189421894 changed_tup_mr = 0
2189521895 tpm_i = 0
2189621896 while tpm_i < tparts_mr.length
@@ -21929,7 +21929,7 @@
2192921929 promote_meth_returns_table(ci, @cls_cmeth_returns)
2193021930 end
2193121931 # Ivars.
21932- ivt = @cls_ivar_types[ci].split(";")
21932+ ivt = @cls_ivar_types[ci].split(";", -1)
2193321933 changed_iv = 0
2193421934 ik = 0
2193521935 while ik < ivt.length
@@ -21956,7 +21956,7 @@
2195621956 changed = 0
2195721957 mj = 0
2195821958 while mj < all_pt.length
21959- pts = all_pt[mj].split(",")
21959+ pts = all_pt[mj].split(",", -1)
2196021960 pk = 0
2196121961 while pk < pts.length
2196221962 if pts[pk] == "int"
@@ -21978,7 +21978,7 @@
2197821978 if ci >= tbl.length
2197921979 return
2198021980 end
21981- rets = tbl[ci].split(";")
21981+ rets = tbl[ci].split(";", -1)
2198221982 changed = 0
2198321983 mj = 0
2198421984 while mj < rets.length
@@ -21993,7 +21993,7 @@
2199321993 # promote mode lifting the ivars to bigint, the tuple build emit
2199421994 # produces sp_Tuple_bigint_bigint_bigint at the call site, so
2199521995 # the return type slot must move too.
21996- tparts_ret = rets[mj][6, rets[mj].length - 6].split(",")
21996+ tparts_ret = rets[mj][6, rets[mj].length - 6].split(",", -1)
2199721997 changed_tup_ret = 0
2199821998 tpr_i = 0
2199921999 while tpr_i < tparts_ret.length
@@ -22049,7 +22049,7 @@
2204922049 if ci < 0 || ci >= @cls_meth_returns.length
2205022050 next
2205122051 end
22052- rets = @cls_meth_returns[ci].split(";")
22052+ rets = @cls_meth_returns[ci].split(";", -1)
2205322053 if midx < rets.length && rets[midx] != rbs_ret
2205422054 rets[midx] = rbs_ret
2205522055 @cls_meth_returns[ci] = rets.join(";")
@@ -22078,7 +22078,7 @@
2207822078 if ci < 0 || ci >= @cls_cmeth_returns.length
2207922079 next
2208022080 end
22081- rets = @cls_cmeth_returns[ci].split(";")
22081+ rets = @cls_cmeth_returns[ci].split(";", -1)
2208222082 if midx < rets.length && rets[midx] != rbs_ret
2208322083 rets[midx] = rbs_ret
2208422084 @cls_cmeth_returns[ci] = rets.join(";")
@@ -22193,11 +22193,11 @@
2219322193 rcname = @nd_name[recv]
2219422194 rci = find_class_idx(rcname)
2219522195 if rci >= 0 && rci < @cls_cmeth_bodies.length
22196- cmnames = @cls_cmeth_names[rci].split(";")
22196+ cmnames = @cls_cmeth_names[rci].split(";", -1)
2219722197 cmj = 0
2219822198 while cmj < cmnames.length
2219922199 if cmnames[cmj] == mname
22200- cmbodies = @cls_cmeth_bodies[rci].split(";")
22200+ cmbodies = @cls_cmeth_bodies[rci].split(";", -1)
2220122201 if cmj < cmbodies.length
2220222202 bid = cmbodies[cmj].to_i
2220322203 end
@@ -22275,7 +22275,7 @@
2227522275 if ci < 0 || ci >= @cls_meth_bodies.length
2227622276 next
2227722277 end
22278- bodies = @cls_meth_bodies[ci].split(";")
22278+ bodies = @cls_meth_bodies[ci].split(";", -1)
2227922279 if midx >= bodies.length
2228022280 next
2228122281 end
@@ -22283,13 +22283,13 @@
2228322283 if bid < 0
2228422284 next
2228522285 end
22286- lits = "".split(",")
22286+ lits = "".split(",", -1)
2228722287 collect_rbs_literal_returns(bid, lits)
2228822288 implicit = rbs_body_implicit_return_literal(bid)
2228922289 if implicit != ""
2229022290 lits.push(implicit)
2229122291 end
22292- mnames = @cls_meth_names[ci].split(";")
22292+ mnames = @cls_meth_names[ci].split(";", -1)
2229322293 mname = midx < mnames.length ? mnames[midx] : "?"
2229422294 li = 0
2229522295 while li < lits.length
@@ -22308,7 +22308,7 @@
2230822308 if ci < 0 || ci >= @cls_cmeth_bodies.length
2230922309 next
2231022310 end
22311- bodies = @cls_cmeth_bodies[ci].split(";")
22311+ bodies = @cls_cmeth_bodies[ci].split(";", -1)
2231222312 if midx >= bodies.length
2231322313 next
2231422314 end
@@ -22316,13 +22316,13 @@
2231622316 if bid < 0
2231722317 next
2231822318 end
22319- lits = "".split(",")
22319+ lits = "".split(",", -1)
2232022320 collect_rbs_literal_returns(bid, lits)
2232122321 implicit = rbs_body_implicit_return_literal(bid)
2232222322 if implicit != ""
2232322323 lits.push(implicit)
2232422324 end
22325- cmnames = @cls_cmeth_names[ci].split(";")
22325+ cmnames = @cls_cmeth_names[ci].split(";", -1)
2232622326 mname = midx < cmnames.length ? cmnames[midx] : "?"
2232722327 li = 0
2232822328 while li < lits.length
@@ -22343,7 +22343,7 @@
2234322343 if bid < 0
2234422344 next
2234522345 end
22346- lits = "".split(",")
22346+ lits = "".split(",", -1)
2234722347 collect_rbs_literal_returns(bid, lits)
2234822348 implicit = rbs_body_implicit_return_literal(bid)
2234922349 if implicit != ""
@@ -22534,7 +22534,7 @@
2253422534 rcname = @nd_name[recv]
2253522535 rci = find_class_idx(rcname)
2253622536 if rci >= 0
22537- mnames_c = @cls_cmeth_names[rci].split(";")
22537+ mnames_c = @cls_cmeth_names[rci].split(";", -1)
2253822538 cmidx = -1
2253922539 mc = 0
2254022540 while mc < mnames_c.length
@@ -22558,7 +22558,7 @@
2255822558 if rbs_pt == ""
2255922559 return
2256022560 end
22561- rbs_ptypes = rbs_pt.split(",")
22561+ rbs_ptypes = rbs_pt.split(",", -1)
2256222562 ak = 0
2256322563 while ak < arg_ids.length && ak < rbs_ptypes.length
2256422564 arg_id = arg_ids[ak]
@@ -22579,13 +22579,13 @@
2257922579 end
2258022580 key = ci.to_s + "|" + midx.to_s
2258122581 if ptypes_token != "-" && ptypes_token != ""
22582- ptypes = ptypes_token.split(",")
22582+ ptypes = ptypes_token.split(",", -1)
2258322583 cls_meth_ptypes_put(ci, midx, ptypes)
2258422584 rbs_mark_cls_meth_seeded(ci, midx)
2258522585 @cls_meth_rbs_ptypes[key] = ptypes_token
2258622586 end
2258722587 if ret != "-" && ret != ""
22588- rets = @cls_meth_returns[ci].split(";")
22588+ rets = @cls_meth_returns[ci].split(";", -1)
2258922589 if midx < rets.length
2259022590 rets[midx] = ret
2259122591 @cls_meth_returns[ci] = rets.join(";")
@@ -22607,7 +22607,7 @@
2260722607 if ci < 0 || ci >= @cls_cmeth_names.length
2260822608 return false
2260922609 end
22610- cmnames = @cls_cmeth_names[ci].split(";")
22610+ cmnames = @cls_cmeth_names[ci].split(";", -1)
2261122611 midx = -1
2261222612 j = 0
2261322613 while j < cmnames.length
@@ -22623,12 +22623,12 @@
2262322623 end
2262422624 key = ci.to_s + "|" + midx.to_s
2262522625 if ptypes_token != "-" && ptypes_token != ""
22626- ptypes = ptypes_token.split(",")
22626+ ptypes = ptypes_token.split(",", -1)
2262722627 cls_cmeth_ptypes_put(ci, midx, ptypes)
2262822628 @cls_cmeth_rbs_ptypes[key] = ptypes_token
2262922629 end
2263022630 if ret != "-" && ret != ""
22631- rets = @cls_cmeth_returns[ci].split(";")
22631+ rets = @cls_cmeth_returns[ci].split(";", -1)
2263222632 if midx < rets.length
2263322633 rets[midx] = ret
2263422634 @cls_cmeth_returns[ci] = rets.join(";")
@@ -22674,8 +22674,8 @@
2267422674 if iname.length > 0 && !iname.start_with?("@")
2267522675 iname = "@" + iname
2267622676 end
22677- names = @cls_ivar_names[ci].split(";")
22678- types = @cls_ivar_types[ci].split(";")
22677+ names = @cls_ivar_names[ci].split(";", -1)
22678+ types = @cls_ivar_types[ci].split(";", -1)
2267922679 j = 0
2268022680 found = -1
2268122681 while j < names.length
@@ -22699,7 +22699,7 @@
2269922699 # arbitrate_rbs_vs_inferred_ivars can restore it after the
2270022700 # iterative inference loop, in case some pass widens the slot
2270122701 # off the RBS pin. Issue #626 sub-issue 2.
22702- rbs_names = @cls_ivar_names[ci].split(";")
22702+ rbs_names = @cls_ivar_names[ci].split(";", -1)
2270322703 rbs_types = @cls_ivar_rbs_types[ci].split(";", -1)
2270422704 while rbs_types.length < rbs_names.length
2270522705 rbs_types.push("")
@@ -23125,7 +23125,7 @@
2312523125 # Top-level method params + returns.
2312623126 rmi = 0
2312723127 while rmi < @meth_names.length
23128- rpt = @meth_param_types[rmi].split(",")
23128+ rpt = @meth_param_types[rmi].split(",", -1)
2312923129 rpi = 0
2313023130 while rpi < rpt.length
2313123131 if rpt[rpi] != ""
@@ -23158,10 +23158,10 @@
2315823158 rci = 0
2315923159 while rci < @cls_names.length
2316023160 r_im_pall = @cls_meth_ptypes[rci].split("|", -1)
23161- r_im_ret = @cls_meth_returns[rci].split(";")
23161+ r_im_ret = @cls_meth_returns[rci].split(";", -1)
2316223162 r_imj = 0
2316323163 while r_imj < r_im_pall.length
23164- r_im_pt = r_im_pall[r_imj].split(",")
23164+ r_im_pt = r_im_pall[r_imj].split(",", -1)
2316523165 r_imk = 0
2316623166 while r_imk < r_im_pt.length
2316723167 if r_im_pt[r_imk] != ""
@@ -23194,10 +23194,10 @@
2319423194 r_imrj = r_imrj + 1
2319523195 end
2319623196 r_cmpall = @cls_cmeth_ptypes[rci].split("|", -1)
23197- r_cmret = @cls_cmeth_returns[rci].split(";")
23197+ r_cmret = @cls_cmeth_returns[rci].split(";", -1)
2319823198 r_cmj = 0
2319923199 while r_cmj < r_cmpall.length
23200- r_cmpt = r_cmpall[r_cmj].split(",")
23200+ r_cmpt = r_cmpall[r_cmj].split(",", -1)
2320123201 r_cmk = 0
2320223202 while r_cmk < r_cmpt.length
2320323203 if r_cmpt[r_cmk] != ""
@@ -23230,7 +23230,7 @@
2323023230 r_cmrj = r_cmrj + 1
2323123231 end
2323223232 # ivars
23233- r_ivt = @cls_ivar_types[rci].split(";")
23233+ r_ivt = @cls_ivar_types[rci].split(";", -1)
2323423234 r_ivj = 0
2323523235 while r_ivj < r_ivt.length
2323623236 if r_ivt[r_ivj] != ""
@@ -23296,8 +23296,8 @@
2329623296 # Top-level + module class methods params.
2329723297 bmi = 0
2329823298 while bmi < @meth_names.length
23299- bpn = @meth_param_names[bmi].split(",")
23300- bpt = @meth_param_types[bmi].split(",")
23299+ bpn = @meth_param_names[bmi].split(",", -1)
23300+ bpt = @meth_param_types[bmi].split(",", -1)
2330123301 bj = 0
2330223302 while bj < bpn.length
2330323303 if bj < bpt.length
@@ -23322,12 +23322,12 @@
2332223322 bcn = @cls_names[bci]
2332323323 b_im_pn = @cls_meth_params[bci].split("|", -1)
2332423324 b_im_pt = @cls_meth_ptypes[bci].split("|", -1)
23325- b_im_mn = @cls_meth_names[bci].split(";")
23326- b_im_rn = @cls_meth_returns[bci].split(";")
23325+ b_im_mn = @cls_meth_names[bci].split(";", -1)
23326+ b_im_rn = @cls_meth_returns[bci].split(";", -1)
2332723327 b_imj = 0
2332823328 while b_imj < b_im_pn.length
23329- b_im_n = b_im_pn[b_imj].split(",")
23330- b_im_t = b_im_pt[b_imj].split(",")
23329+ b_im_n = b_im_pn[b_imj].split(",", -1)
23330+ b_im_t = b_im_pt[b_imj].split(",", -1)
2333123331 b_im_mname = b_imj < b_im_mn.length ? b_im_mn[b_imj] : "?"
2333223332 b_imk = 0
2333323333 while b_imk < b_im_n.length
@@ -23349,12 +23349,12 @@
2334923349 end
2335023350 b_cm_pn = @cls_cmeth_params[bci].split("|", -1)
2335123351 b_cm_pt = @cls_cmeth_ptypes[bci].split("|", -1)
23352- b_cm_mn = @cls_cmeth_names[bci].split(";")
23353- b_cm_rn = @cls_cmeth_returns[bci].split(";")
23352+ b_cm_mn = @cls_cmeth_names[bci].split(";", -1)
23353+ b_cm_rn = @cls_cmeth_returns[bci].split(";", -1)
2335423354 b_cmj = 0
2335523355 while b_cmj < b_cm_pn.length
23356- b_cm_n = b_cm_pn[b_cmj].split(",")
23357- b_cm_t = b_cm_pt[b_cmj].split(",")
23356+ b_cm_n = b_cm_pn[b_cmj].split(",", -1)
23357+ b_cm_t = b_cm_pt[b_cmj].split(",", -1)
2335823358 b_cm_mname = b_cmj < b_cm_mn.length ? b_cm_mn[b_cmj] : "?"
2335923359 b_cmk = 0
2336023360 while b_cmk < b_cm_n.length
@@ -23374,8 +23374,8 @@
2337423374 end
2337523375 b_cmj = b_cmj + 1
2337623376 end
23377- b_ivn = @cls_ivar_names[bci].split(";")
23378- b_ivt = @cls_ivar_types[bci].split(";")
23377+ b_ivn = @cls_ivar_names[bci].split(";", -1)
23378+ b_ivt = @cls_ivar_types[bci].split(";", -1)
2337923379 b_ivj = 0
2338023380 while b_ivj < b_ivn.length
2338123381 if b_ivj < b_ivt.length
@@ -23404,7 +23404,7 @@
2340423404
2340523405 def pre_detect_bigint
2340623406 stmts = get_body_stmts(@root_id)
23407- bigint_names = "".split(",")
23407+ bigint_names = "".split(",", -1)
2340823408 stmts.each { |sid|
2340923409 scan_bigint_candidates(sid, bigint_names)
2341023410 }
@@ -23475,7 +23475,7 @@
2347523475 return 0
2347623476 end
2347723477 # Search for assignments where src == var_name
23478- pairs = @bi_assigns.split(",")
23478+ pairs = @bi_assigns.split(",", -1)
2347923479 i = 0
2348023480 while i < pairs.length
2348123481 parts = pairs[i].split(":")
@@ -23608,7 +23608,7 @@
2360823608 # them here also means codegen no longer needs them once it stops
2360923609 # doing its own scope refinement.
2361023610 def detect_bigint_vars(stmts, names, types)
23611- bigint_names = "".split(",")
23611+ bigint_names = "".split(",", -1)
2361223612 stmts.each { |sid|
2361323613 scan_bigint_candidates(sid, bigint_names)
2361423614 }
@@ -23634,7 +23634,7 @@
2363423634 def scan_bigint_propagate(stmts, names, types)
2363523635 changed = 1
2363623636 iter = 0
23637- sig_hist = "".split(",")
23637+ sig_hist = "".split(",", -1)
2363823638 while changed == 1
2363923639 iter = iter + 1
2364023640 if iter > 256
@@ -23766,7 +23766,7 @@
2376623766 # Build into a local array and assign at the end.
2376723767 # (Pushing directly to @sym_names in this loop triggers a
2376823768 # self-host codegen regression — see HANDOFF notes.)
23769- local = "".split(",")
23769+ local = "".split(",", -1)
2377023770 i = 0
2377123771 while i < @nd_type.length
2377223772 t = @nd_type[i]
@@ -23933,7 +23933,7 @@
2393323933 elsif t == "StatementsNode"
2393423934 stmts = @nd_stmts[bid]
2393523935 if stmts != ""
23936- parts = stmts.split(",")
23936+ parts = stmts.split(",", -1)
2393723937 if parts.length == 1
2393823938 sid = parts[0].to_i
2393923939 if sid >= 0 && sid < @nd_count && @nd_type[sid] == "InstanceVariableWriteNode"
@@ -23958,9 +23958,9 @@
2395823958 if mnames_str == ""
2395923959 return 0
2396023960 end
23961- mnames = mnames_str.split(";")
23962- bodies = @cls_meth_bodies[ci].split(";")
23963- writers = @cls_attr_writers[ci].split(";")
23961+ mnames = mnames_str.split(";", -1)
23962+ bodies = @cls_meth_bodies[ci].split(";", -1)
23963+ writers = @cls_attr_writers[ci].split(";", -1)
2396423964 mi = 0
2396523965 while mi < mnames.length
2396623966 mn = mnames[mi]
@@ -24004,9 +24004,9 @@
2400424004 while i < @cls_names.length
2400524005 mnames_str = @cls_meth_names[i]
2400624006 if mnames_str != ""
24007- mnames = mnames_str.split(";")
24008- bodies = @cls_meth_bodies[i].split(";")
24009- writers = @cls_attr_writers[i].split(";")
24007+ mnames = mnames_str.split(";", -1)
24008+ bodies = @cls_meth_bodies[i].split(";", -1)
24009+ writers = @cls_attr_writers[i].split(";", -1)
2401024010 mi = 0
2401124011 while mi < mnames.length
2401224012 mn = mnames[mi]
@@ -24045,7 +24045,7 @@
2404524045 if t == "StatementsNode"
2404624046 stmts = @nd_stmts[bid]
2404724047 if stmts != ""
24048- parts = stmts.split(",")
24048+ parts = stmts.split(",", -1)
2404924049 if parts.length == 1
2405024050 sid = parts[0].to_i
2405124051 if sid >= 0 && sid < @nd_count
@@ -24073,9 +24073,9 @@
2407324073 while i < @cls_names.length
2407424074 mnames_str = @cls_meth_names[i]
2407524075 if mnames_str != ""
24076- mnames = mnames_str.split(";")
24077- bodies = @cls_meth_bodies[i].split(";")
24078- readers = @cls_attr_readers[i].split(";")
24076+ mnames = mnames_str.split(";", -1)
24077+ bodies = @cls_meth_bodies[i].split(";", -1)
24078+ readers = @cls_attr_readers[i].split(";", -1)
2407924079 mi = 0
2408024080 while mi < mnames.length
2408124081 mn = mnames[mi]
@@ -24177,7 +24177,7 @@
2417724177 # such classes from the value-type optimization keeps `<C>` heap-
2417824178 # allocated, so the constructor returns `sp_<C> *` and boxing is
2417924179 # well-typed. Mirrors the ptr_array exclusion .
24180- @poly_returned_types = "".split(",")
24180+ @poly_returned_types = "".split(",", -1)
2418124181 mi = 0
2418224182 while mi < @meth_names.length
2418324183 if mi < @meth_return_types.length && @meth_return_types[mi] == "poly"
@@ -24190,8 +24190,8 @@
2419024190 end
2419124191 ci = 0
2419224192 while ci < @cls_names.length
24193- bodies = @cls_meth_bodies[ci].split(";")
24194- returns = @cls_meth_returns[ci].split(";")
24193+ bodies = @cls_meth_bodies[ci].split(";", -1)
24194+ returns = @cls_meth_returns[ci].split(";", -1)
2419524195 mj = 0
2419624196 while mj < bodies.length
2419724197 if mj < returns.length && returns[mj] == "poly"
@@ -24222,7 +24222,7 @@
2422224222 # same struct-by-void-* mismatch the ptr_array / poly-return
2422324223 # passes already guard against.
2422424224 def detect_poly_arg_passed_types
24225- @poly_arg_passed_types = "".split(",")
24225+ @poly_arg_passed_types = "".split(",", -1)
2422624226 nid = 0
2422724227 while nid < @nd_type.length
2422824228 if @nd_type[nid] == "CallNode"
@@ -24244,8 +24244,8 @@
2424424244 if mfn != ""
2424524245 mi = find_method_idx(mfn)
2424624246 if mi >= 0
24247- pnames = @meth_param_names[mi].split(",")
24248- ptypes = @meth_param_types[mi].split(",")
24247+ pnames = @meth_param_names[mi].split(",", -1)
24248+ ptypes = @meth_param_types[mi].split(",", -1)
2424924249 args_id = @nd_arguments[nid]
2425024250 if args_id >= 0
2425124251 arg_ids = get_args(args_id)
@@ -24263,13 +24263,13 @@
2426324263 if init_idx >= 0
2426424264 all_params = @cls_meth_params[ci2].split("|", -1)
2426524265 all_ptypes = @cls_meth_ptypes[ci2].split("|", -1)
24266- pnames2 = "".split(",")
24267- ptypes2 = "".split(",")
24266+ pnames2 = "".split(",", -1)
24267+ ptypes2 = "".split(",", -1)
2426824268 if init_idx < all_params.length
24269- pnames2 = all_params[init_idx].split(",")
24269+ pnames2 = all_params[init_idx].split(",", -1)
2427024270 end
2427124271 if init_idx < all_ptypes.length
24272- ptypes2 = all_ptypes[init_idx].split(",")
24272+ ptypes2 = all_ptypes[init_idx].split(",", -1)
2427324273 end
2427424274 args_id2 = @nd_arguments[nid]
2427524275 if args_id2 >= 0
@@ -24338,7 +24338,7 @@
2433824338 # `_push` takes `void *`; if `<C>` were optimized into a value type
2433924339 # then `sp_<C>_new(...)` would return the struct by value and the
2434024340 # generated push call would be a C type error.
24341- @ptr_array_stored_types = "".split(",")
24341+ @ptr_array_stored_types = "".split(",", -1)
2434224342 nid = 0
2434324343 while nid < @nd_type.length
2434424344 if @nd_type[nid] == "ArrayNode"
@@ -24383,27 +24383,27 @@
2438324383
2438424384 def detect_param_mutated_types
2438524385 # Find classes whose instances are mutated when passed as method parameters
24386- @param_mutated_types = "".split(",")
24386+ @param_mutated_types = "".split(",", -1)
2438724387 i = 0
2438824388 while i < @cls_names.length
2438924389 mnames_str = @cls_meth_names[i]
2439024390 if mnames_str != ""
24391- mnames = mnames_str.split(";")
24391+ mnames = mnames_str.split(";", -1)
2439224392 all_params = @cls_meth_params[i].split("|", -1)
2439324393 all_ptypes = @cls_meth_ptypes[i].split("|", -1)
24394- bodies = @cls_meth_bodies[i].split(";")
24394+ bodies = @cls_meth_bodies[i].split(";", -1)
2439524395 mi = 0
2439624396 while mi < mnames.length
2439724397 if mi < bodies.length && mi < all_params.length
2439824398 bid = bodies[mi].to_i
24399- pnames = all_params[mi].split(",")
24400- ptypes = "".split(",")
24399+ pnames = all_params[mi].split(",", -1)
24400+ ptypes = "".split(",", -1)
2440124401 if mi < all_ptypes.length
24402- ptypes = all_ptypes[mi].split(",")
24402+ ptypes = all_ptypes[mi].split(",", -1)
2440324403 end
2440424404 # Collect object-type param names
24405- obj_param_names = "".split(",")
24406- obj_param_types = "".split(",")
24405+ obj_param_names = "".split(",", -1)
24406+ obj_param_types = "".split(",", -1)
2440724407 pj = 0
2440824408 while pj < pnames.length
2440924409 pt = "int"
@@ -24439,10 +24439,10 @@
2443924439 mi = 0
2444024440 while mi < @meth_names.length
2444124441 bid = @meth_body_ids[mi]
24442- pnames = @meth_param_names[mi].split(",")
24443- ptypes = @meth_param_types[mi].split(",")
24444- obj_param_names = "".split(",")
24445- obj_param_types = "".split(",")
24442+ pnames = @meth_param_names[mi].split(",", -1)
24443+ ptypes = @meth_param_types[mi].split(",", -1)
24444+ obj_param_names = "".split(",", -1)
24445+ obj_param_types = "".split(",", -1)
2444624446 pj = 0
2444724447 while pj < pnames.length
2444824448 pt = "int"
@@ -24484,16 +24484,16 @@
2448424484 # `<recv>.method(:foo)` can resolve `<recv>` (a local, an ivar via
2448524485 # attr_reader, or a chained call) back to its `obj_<X>` type.
2448624486 def detect_method_taken_classes
24487- @method_taken_class_indices = "".split(",")
24487+ @method_taken_class_indices = "".split(",", -1)
2448824488 # Walk class methods first.
2448924489 i = 0
2449024490 while i < @cls_names.length
2449124491 mnames_str = @cls_meth_names[i]
2449224492 if mnames_str != ""
24493- mnames = mnames_str.split(";")
24493+ mnames = mnames_str.split(";", -1)
2449424494 all_params = @cls_meth_params[i].split("|", -1)
2449524495 all_ptypes = @cls_meth_ptypes[i].split("|", -1)
24496- bodies = @cls_meth_bodies[i].split(";")
24496+ bodies = @cls_meth_bodies[i].split(";", -1)
2449724497 saved_ci = @current_class_idx
2449824498 @current_class_idx = i
2449924499 mi = 0
@@ -24533,11 +24533,11 @@
2453324533 if @nd_type[@root_id] == "ProgramNode"
2453424534 stmts = get_body_stmts(@root_id)
2453524535 push_scope
24536- lnames = "".split(",")
24537- ltypes = "".split(",")
24536+ lnames = "".split(",", -1)
24537+ ltypes = "".split(",", -1)
2453824538 sk = 0
2453924539 while sk < stmts.length
24540- scan_locals(stmts[sk], lnames, ltypes, "".split(","))
24540+ scan_locals(stmts[sk], lnames, ltypes, "".split(",", -1))
2454124541 sk = sk + 1
2454224542 end
2454324543 lk = 0
@@ -24556,8 +24556,8 @@
2455624556
2455724557 def method_taken_walk_with_scope(bid, pnames_str, ptypes_str, enclosing_ci)
2455824558 push_scope
24559- pnames = pnames_str.split(",")
24560- ptypes = ptypes_str.split(",")
24559+ pnames = pnames_str.split(",", -1)
24560+ ptypes = ptypes_str.split(",", -1)
2456124561 k = 0
2456224562 while k < pnames.length
2456324563 pt = "int"
@@ -24567,8 +24567,8 @@
2456724567 declare_var(pnames[k], pt)
2456824568 k = k + 1
2456924569 end
24570- lnames = "".split(",")
24571- ltypes = "".split(",")
24570+ lnames = "".split(",", -1)
24571+ ltypes = "".split(",", -1)
2457224572 scan_locals(bid, lnames, ltypes, pnames)
2457324573 lk = 0
2457424574 while lk < lnames.length
@@ -24661,8 +24661,8 @@
2466124661 2.times do
2466224662 i = 0
2466324663 while i < @cls_names.length
24664- names = @cls_ivar_names[i].split(";")
24665- types = @cls_ivar_types[i].split(";")
24664+ names = @cls_ivar_names[i].split(";", -1)
24665+ types = @cls_ivar_types[i].split(";", -1)
2466624666 # Value-type candidates: small immutable scalar classes.
2466724667 # Limit to 8 ivars so the struct stays register-friendly.
2466824668 if names.length > 0 && names.length <= 8
@@ -24679,7 +24679,7 @@
2467924679 if cls_has_self_mutating_methods(i) == 1
2468024680 all_val = 0
2468124681 end
24682- writers = @cls_attr_writers[i].split(";")
24682+ writers = @cls_attr_writers[i].split(";", -1)
2468324683 if writers.length > 0 && writers[0] != ""
2468424684 all_val = 0
2468524685 end
@@ -24787,8 +24787,8 @@
2478724787 i = i + 1
2478824788 next
2478924789 end
24790- names = @cls_ivar_names[i].split(";")
24791- types = @cls_ivar_types[i].split(";")
24790+ names = @cls_ivar_names[i].split(";", -1)
24791+ types = @cls_ivar_types[i].split(";", -1)
2479224792 eligible = 1
2479324793 if names.length == 0 || names.length > 8
2479424794 eligible = 0
@@ -24816,9 +24816,9 @@
2481624816 end
2481724817 # Only initialize + attr_* methods (no custom methods).
2481824818 if eligible == 1
24819- mnames = @cls_meth_names[i].split(";")
24820- readers = @cls_attr_readers[i].split(";")
24821- writers = @cls_attr_writers[i].split(";")
24819+ mnames = @cls_meth_names[i].split(";", -1)
24820+ readers = @cls_attr_readers[i].split(";", -1)
24821+ writers = @cls_attr_writers[i].split(";", -1)
2482224822 mk = 0
2482324823 while mk < mnames.length
2482424824 mn = mnames[mk]
@@ -24870,7 +24870,7 @@
2487024870
2487124871
2487224872 def ivar_in_chain(ci, iname)
24873- names = @cls_ivar_names[ci].split(";")
24873+ names = @cls_ivar_names[ci].split(";", -1)
2487424874 k = 0
2487524875 while k < names.length
2487624876 if names[k] == iname
@@ -24947,7 +24947,7 @@
2494724947 if @cls_meth_idx_cache.key?(ck)
2494824948 return @cls_meth_idx_cache[ck]
2494924949 end
24950- mnames = @cls_meth_names[ci].split(";")
24950+ mnames = @cls_meth_names[ci].split(";", -1)
2495124951 j = 0
2495224952 while j < mnames.length
2495324953 if mnames[j] == mname
@@ -24969,7 +24969,7 @@
2496924969 # site closes with two join() calls.
2497024970 def cls_meth_ptypes_get(ci, midx)
2497124971 if ci < 0 || ci >= @cls_meth_ptypes.length || midx < 0
24972- return "".split(",")
24972+ return "".split(",", -1)
2497324973 end
2497424974 if @cmp_outer_version != @cls_meth_ptypes_version || @cmp_outer_ci != ci
2497524975 @cmp_outer_split = @cls_meth_ptypes[ci].split("|", -1)
@@ -24977,9 +24977,9 @@
2497724977 @cmp_outer_version = @cls_meth_ptypes_version
2497824978 end
2497924979 if midx >= @cmp_outer_split.length
24980- return "".split(",")
24980+ return "".split(",", -1)
2498124981 end
24982- @cmp_outer_split[midx].split(",")
24982+ @cmp_outer_split[midx].split(",", -1)
2498324983 end
2498424984
2498524985 def cls_meth_ptypes_put(ci, midx, ptypes)
@@ -25005,7 +25005,7 @@
2500525005
2500625006 def cls_meth_pnames_get(ci, midx)
2500725007 if ci < 0 || ci >= @cls_meth_params.length || midx < 0
25008- return "".split(",")
25008+ return "".split(",", -1)
2500925009 end
2501025010 if @cmn_outer_version != @cls_meth_params_version || @cmn_outer_ci != ci
2501125011 @cmn_outer_split = @cls_meth_params[ci].split("|", -1)
@@ -25013,14 +25013,14 @@
2501325013 @cmn_outer_version = @cls_meth_params_version
2501425014 end
2501525015 if midx >= @cmn_outer_split.length
25016- return "".split(",")
25016+ return "".split(",", -1)
2501725017 end
25018- @cmn_outer_split[midx].split(",")
25018+ @cmn_outer_split[midx].split(",", -1)
2501925019 end
2502025020
2502125021 def cls_cmeth_ptypes_get(ci, midx)
2502225022 if ci < 0 || ci >= @cls_cmeth_ptypes.length || midx < 0
25023- return "".split(",")
25023+ return "".split(",", -1)
2502425024 end
2502525025 if @ccmp_outer_version != @cls_cmeth_ptypes_version || @ccmp_outer_ci != ci
2502625026 @ccmp_outer_split = @cls_cmeth_ptypes[ci].split("|", -1)
@@ -25028,9 +25028,9 @@
2502825028 @ccmp_outer_version = @cls_cmeth_ptypes_version
2502925029 end
2503025030 if midx >= @ccmp_outer_split.length
25031- return "".split(",")
25031+ return "".split(",", -1)
2503225032 end
25033- @ccmp_outer_split[midx].split(",")
25033+ @ccmp_outer_split[midx].split(",", -1)
2503425034 end
2503525035
2503625036 def cls_cmeth_ptypes_put(ci, midx, ptypes)
@@ -25053,7 +25053,7 @@
2505325053
2505425054 def cls_cmeth_pnames_get(ci, midx)
2505525055 if ci < 0 || ci >= @cls_cmeth_params.length || midx < 0
25056- return "".split(",")
25056+ return "".split(",", -1)
2505725057 end
2505825058 if @ccmn_outer_version != @cls_cmeth_params_version || @ccmn_outer_ci != ci
2505925059 @ccmn_outer_split = @cls_cmeth_params[ci].split("|", -1)
@@ -25061,9 +25061,9 @@
2506125061 @ccmn_outer_version = @cls_cmeth_params_version
2506225062 end
2506325063 if midx >= @ccmn_outer_split.length
25064- return "".split(",")
25064+ return "".split(",", -1)
2506525065 end
25066- @ccmn_outer_split[midx].split(",")
25066+ @ccmn_outer_split[midx].split(",", -1)
2506725067 end
2506825068
2506925069 # Walk the inheritance chain starting at class `ci` looking for the
@@ -25120,8 +25120,8 @@
2512025120 while iter < 8
2512125121 i = 0
2512225122 while i < @cls_names.length
25123- cmnames = @cls_cmeth_names[i].split(";")
25124- cm_bodies = @cls_cmeth_bodies[i].split(";")
25123+ cmnames = @cls_cmeth_names[i].split(";", -1)
25124+ cm_bodies = @cls_cmeth_bodies[i].split(";", -1)
2512525125 j = 0
2512625126 while j < cmnames.length
2512725127 if cmnames[j] != "" && cls_cmeth_is_live(i, cmnames[j]) == 1
@@ -25180,7 +25180,7 @@
2518025180 "+", "-", "*", "/", "%", "<<", "coerce", "<<="]
2518125181 ci = 0
2518225182 while ci < @cls_names.length
25183- mnames_init = @cls_meth_names[ci].split(";")
25183+ mnames_init = @cls_meth_names[ci].split(";", -1)
2518425184 mj_init = 0
2518525185 while mj_init < mnames_init.length
2518625186 ai = 0
@@ -25196,9 +25196,9 @@
2519625196 end
2519725197 # Step 2/3: collect every CallNode name + SymbolNode value, mark
2519825198 # methods on every class that has them.
25199- # `"".split(",")` initializer types `used` as a str_array, since
25199+ # `"".split(",", -1)` initializer types `used` as a str_array, since
2520025200 # `acc` in collect_used_method_names is pushed strings only.
25201- used = "".split(",")
25201+ used = "".split(",", -1)
2520225202 collect_used_method_names(@root_id, used)
2520325203 # Lifted instance_eval blocks: their bodies were detached from
2520425204 # @root_id by ieval_rewrite_call and stashed in @ieval_body_ids,
@@ -25220,7 +25220,7 @@
2522025220 end
2522125221 ci_b = 0
2522225222 while ci_b < @cls_names.length
25223- mb_list = @cls_meth_bodies[ci_b].split(";")
25223+ mb_list = @cls_meth_bodies[ci_b].split(";", -1)
2522425224 mbk = 0
2522525225 while mbk < mb_list.length
2522625226 bid_mb = mb_list[mbk].to_i
@@ -25229,7 +25229,7 @@
2522925229 end
2523025230 mbk = mbk + 1
2523125231 end
25232- cmb_list = @cls_cmeth_bodies[ci_b].split(";")
25232+ cmb_list = @cls_cmeth_bodies[ci_b].split(";", -1)
2523325233 cmbk = 0
2523425234 while cmbk < cmb_list.length
2523525235 bid_cmb = cmb_list[cmbk].to_i
@@ -25245,7 +25245,7 @@
2524525245 uname = used[ui]
2524625246 ci2 = 0
2524725247 while ci2 < @cls_names.length
25248- mns = @cls_meth_names[ci2].split(";")
25248+ mns = @cls_meth_names[ci2].split(";", -1)
2524925249 mj2 = 0
2525025250 while mj2 < mns.length
2525125251 if mns[mj2] == uname
@@ -25344,7 +25344,7 @@
2534425344 if ci < 0 || ci >= @cls_names.length
2534525345 return
2534625346 end
25347- cmnames = @cls_cmeth_names[ci].split(";")
25347+ cmnames = @cls_cmeth_names[ci].split(";", -1)
2534825348 has = 0
2534925349 k = 0
2535025350 while k < cmnames.length
@@ -25445,7 +25445,7 @@
2544525445 mod_name = @nd_name[inner_recv]
2544625446 resolved = module_acc_resolved(mod_name, @nd_name[recv])
2544725447 if resolved != "" && resolved != "?"
25448- rnames = resolved.split(";")
25448+ rnames = resolved.split(";", -1)
2544925449 ri = 0
2545025450 while ri < rnames.length
2545125451 tci2 = find_class_idx(rnames[ri])
@@ -25631,17 +25631,17 @@
2563125631 # by an explicit literal write, "" otherwise. Reset when called with
2563225632 # a fresh (empty) names array.
2563325633 if names.length == 0
25634- @scan_literal_flags = "".split(",")
25634+ @scan_literal_flags = "".split(",", -1)
2563525635 # Parallel to `names`: "1" if every write to this local so far was
2563625636 # an empty `[]` literal — used to defer the array element type
2563725637 # until first `push` . A subsequent write with a
2563825638 # concrete element resets the flag to "".
25639- @scan_empty_flags = "".split(",")
25639+ @scan_empty_flags = "".split(",", -1)
2564025640 # Parallel to `names`: "1" if the FIRST write to this local was an
2564125641 # empty `{}` literal — promote_empty_hash_local_writes uses this to
2564225642 # decide whether to refine str_int_hash (the empty-hash default)
2564325643 # to a more specific variant on first []= write.
25644- @scan_empty_hash_flags = "".split(",")
25644+ @scan_empty_hash_flags = "".split(",", -1)
2564525645 end
2564625646 # `case x in [a, b, c]` -- the bound LVs in the array pattern's
2564725647 # requireds list need to live in the surrounding scope so the
@@ -26141,13 +26141,13 @@
2614126141 icm_aargs = get_args(icm_args_id)
2614226142 icm_all_ptypes = @cls_meth_ptypes[icm_owner_ci].split("|", -1)
2614326143 icm_all_empty = @cls_meth_ptypes_empty[icm_owner_ci].split("|", -1)
26144- icm_ptypes = "".split(",")
26145- icm_empties = "".split(",")
26144+ icm_ptypes = "".split(",", -1)
26145+ icm_empties = "".split(",", -1)
2614626146 if icm_midx < icm_all_ptypes.length
26147- icm_ptypes = icm_all_ptypes[icm_midx].split(",")
26147+ icm_ptypes = icm_all_ptypes[icm_midx].split(",", -1)
2614826148 end
2614926149 if icm_midx < icm_all_empty.length
26150- icm_empties = icm_all_empty[icm_midx].split(",")
26150+ icm_empties = icm_all_empty[icm_midx].split(",", -1)
2615126151 end
2615226152 icm_changed = 0
2615326153 icm_k = 0
@@ -26225,12 +26225,12 @@
2622526225 ea_args_id = @nd_arguments[nid]
2622626226 if ea_args_id >= 0
2622726227 ea_aargs = get_args(ea_args_id)
26228- ea_ptypes = @meth_param_types[ea_mi].split(",")
26228+ ea_ptypes = @meth_param_types[ea_mi].split(",", -1)
2622926229 ea_empty_str = ""
2623026230 if ea_mi < @meth_param_empty.length
2623126231 ea_empty_str = @meth_param_empty[ea_mi]
2623226232 end
26233- ea_empties = ea_empty_str.split(",")
26233+ ea_empties = ea_empty_str.split(",", -1)
2623426234 ea_changed = 0
2623526235 ea_k = 0
2623626236 while ea_k < ea_aargs.length
@@ -26713,7 +26713,7 @@
2671326713 if owner_ci_each >= 0
2671426714 owner_midx_each = cls_find_method(owner_ci_each, mname)
2671526715 arity_each = cls_method_yield_arity(owner_ci_each, owner_midx_each)
26716- ytypes_each = "".split(",")
26716+ ytypes_each = "".split(",", -1)
2671726717 ka = 0
2671826718 while ka < arity_each
2671926719 ytypes_each.push("")
@@ -26729,11 +26729,11 @@
2672926729 # default) and we'd miss the body-driven type.
2673026730 if ybid_each >= 0
2673126731 push_scope
26732- yl_names = "".split(",")
26733- yl_types = "".split(",")
26732+ yl_names = "".split(",", -1)
26733+ yl_types = "".split(",", -1)
2673426734 saved_ci_each = @current_class_idx
2673526735 @current_class_idx = owner_ci_each
26736- scan_locals(ybid_each, yl_names, yl_types, "".split(","))
26736+ scan_locals(ybid_each, yl_names, yl_types, "".split(",", -1))
2673726737 yj = 0
2673826738 while yj < yl_names.length
2673926739 declare_var(yl_names[yj], yl_types[yj])
@@ -26762,16 +26762,16 @@
2676226762 ybid_628 = @meth_body_ids[mi_628]
2676326763 if ybid_628 >= 0
2676426764 arity_628 = method_yield_arity(mi_628)
26765- ytypes_628 = "".split(",")
26765+ ytypes_628 = "".split(",", -1)
2676626766 ka_628 = 0
2676726767 while ka_628 < arity_628
2676826768 ytypes_628.push("")
2676926769 ka_628 = ka_628 + 1
2677026770 end
2677126771 push_scope
26772- yl_names_628 = "".split(",")
26773- yl_types_628 = "".split(",")
26774- scan_locals(ybid_628, yl_names_628, yl_types_628, "".split(","))
26772+ yl_names_628 = "".split(",", -1)
26773+ yl_types_628 = "".split(",", -1)
26774+ scan_locals(ybid_628, yl_names_628, yl_types_628, "".split(",", -1))
2677526775 yj_628 = 0
2677626776 while yj_628 < yl_names_628.length
2677726777 declare_var(yl_names_628[yj_628], yl_types_628[yj_628])
@@ -27208,7 +27208,7 @@
2720827208 return @current_method_name[0, cls_idx]
2720927209 end
2721027210 if @current_class_idx >= 0 && @current_class_idx < @cls_names.length
27211- cm = @cls_cmeth_names[@current_class_idx].split(";")
27211+ cm = @cls_cmeth_names[@current_class_idx].split(";", -1)
2721227212 k = 0
2721327213 while k < cm.length
2721427214 if cm[k] == @current_method_name
@@ -27270,7 +27270,7 @@
2727027270 # parent chain so a subclass call to an inherited
2727127271 # attr_accessor reader is recognised (issue #508 analyze side).
2727227272 def cls_has_attr_reader(ci, mname)
27273- readers = @cls_attr_readers[ci].split(";")
27273+ readers = @cls_attr_readers[ci].split(";", -1)
2727427274 j = 0
2727527275 while j < readers.length
2727627276 if readers[j] == mname
@@ -27349,7 +27349,7 @@
2734927349 if obs == ""
2735027350 return 0
2735127351 end
27352- distinct = obs.split(",")
27352+ distinct = obs.split(",", -1)
2735327353 saw_any = 0
2735427354 di = 0
2735527355 while di < distinct.length
@@ -27387,7 +27387,7 @@
2738727387 return @lv_alias_cache[cache_key]
2738827388 end
2738927389 found = ""
27390- bodies = @cls_meth_bodies[@current_class_idx].split(";")
27390+ bodies = @cls_meth_bodies[@current_class_idx].split(";", -1)
2739127391 bi = 0
2739227392 while bi < bodies.length
2739327393 bid = bodies[bi].to_i
@@ -27455,7 +27455,7 @@
2745527455 if ci < 0 || ci >= @cls_ivar_observed_types.length
2745627456 return ""
2745727457 end
27458- names = @cls_ivar_names[ci].split(";")
27458+ names = @cls_ivar_names[ci].split(";", -1)
2745927459 parts = @cls_ivar_observed_types[ci].split(";", -1)
2746027460 k = 0
2746127461 while k < names.length
@@ -27500,7 +27500,7 @@
2750027500 have_poly = 0
2750127501 seen_non_obj = 0
2750227502 if obs != ""
27503- parts = obs.split(",")
27503+ parts = obs.split(",", -1)
2750427504 k = 0
2750527505 while k < parts.length
2750627506 t = parts[k]
@@ -27543,7 +27543,7 @@
2754327543 return ""
2754427544 end
2754527545 if walked != ""
27546- walked.split(",").each { |w| out = obs_add(out, w) }
27546+ walked.split(",", -1).each { |w| out = obs_add(out, w) }
2754727547 end
2754827548 if out == ""
2754927549 return ""
@@ -27556,7 +27556,7 @@
2755627556 if out == ""
2755727557 return cidx_str
2755827558 end
27559- cur = out.split(",")
27559+ cur = out.split(",", -1)
2756027560 k = 0
2756127561 while k < cur.length
2756227562 if cur[k] == cidx_str
@@ -27587,8 +27587,8 @@
2758727587 return @ivar_concrete_recover_cache[ck]
2758827588 end
2758927589 out = ""
27590- mnames_w = @cls_meth_names[ci].split(";")
27591- bodies_w = @cls_meth_bodies[ci].split(";")
27590+ mnames_w = @cls_meth_names[ci].split(";", -1)
27591+ bodies_w = @cls_meth_bodies[ci].split(";", -1)
2759227592 mi_w = 0
2759327593 while mi_w < mnames_w.length
2759427594 bid_w = -1
@@ -27604,7 +27604,7 @@
2760427604 return "?"
2760527605 end
2760627606 if result_for_meth != ""
27607- result_for_meth.split(",").each { |w| out = obs_add(out, w) }
27607+ result_for_meth.split(",", -1).each { |w| out = obs_add(out, w) }
2760827608 end
2760927609 end
2761027610 mi_w = mi_w + 1
@@ -27647,7 +27647,7 @@
2764727647 if call_obs == "?"
2764827648 poison = 1
2764927649 elsif call_obs != ""
27650- call_obs.split(",").each { |w| out = obs_add(out, w) }
27650+ call_obs.split(",", -1).each { |w| out = obs_add(out, w) }
2765127651 end
2765227652 end
2765327653 end
@@ -27828,7 +27828,7 @@
2782827828 if ci < 0
2782927829 return ""
2783027830 end
27831- mnames = @cls_meth_names[ci].split(";")
27831+ mnames = @cls_meth_names[ci].split(";", -1)
2783227832 j = 0
2783327833 while j < mnames.length
2783427834 if mnames[j] == mname
@@ -27846,10 +27846,10 @@
2784627846 end
2784727847
2784827848 # if midx is out of range or the body id is invalid. Centralises
27849- # the @cls_meth_bodies[ci].split(";")[midx].to_i parse so detectors
27849+ # the @cls_meth_bodies[ci].split(";", -1)[midx].to_i parse so detectors
2785027850 # don't have to inline it.
2785127851 def cls_method_body_id(ci, midx)
27852- bodies = @cls_meth_bodies[ci].split(";")
27852+ bodies = @cls_meth_bodies[ci].split(";", -1)
2785327853 if midx >= bodies.length
2785427854 return -1
2785527855 end
@@ -27899,7 +27899,7 @@
2789927899 end
2790027900
2790127901 def cls_method_has_yield(ci, midx)
27902- ystr = @cls_meth_has_yield[ci].split(";")
27902+ ystr = @cls_meth_has_yield[ci].split(";", -1)
2790327903 if midx < ystr.length
2790427904 if ystr[midx] == "1"
2790527905 return 1
@@ -27963,7 +27963,7 @@
2796327963 if ci < 0 || midx < 0
2796427964 return 1
2796527965 end
27966- bodies = @cls_meth_bodies[ci].split(";")
27966+ bodies = @cls_meth_bodies[ci].split(";", -1)
2796727967 if midx >= bodies.length
2796827968 return 1
2796927969 end
@@ -28627,7 +28627,7 @@
2862728627 # (one per reachable node, ~150K on spinel_codegen.rb) that
2862828628 # quadratic blew up the spinel-compiled binary's heap to 60GB
2862928629 # before crashing.
28630- rec_buf = "".split(",")
28630+ rec_buf = "".split(",", -1)
2863128631 ni = 0
2863228632 while ni < @nd_count
2863328633 t = @nd_inferred_type[ni]
@@ -28849,7 +28849,7 @@
2884928849 if nt == "CallNode" && @nd_receiver[nid] < 0 && @nd_name[nid] != "new" && @current_class_idx >= 0
2885028850 mn_check = @nd_name[nid]
2885128851 if find_method_idx(mn_check) < 0
28852- cmnames_check = @cls_cmeth_names[@current_class_idx].split(";")
28852+ cmnames_check = @cls_cmeth_names[@current_class_idx].split(";", -1)
2885328853 ccheck = 0
2885428854 while ccheck < cmnames_check.length
2885528855 if cmnames_check[ccheck] == mn_check
@@ -28927,8 +28927,8 @@
2892728927 # Refinement passes — re-scan with declared scope; promote refined types.
2892828928 pass = 0
2892928929 while pass < 2
28930- ln = "".split(",")
28931- lt = "".split(",")
28930+ ln = "".split(",", -1)
28931+ lt = "".split(",", -1)
2893228932 si = 0
2893328933 while si < stmts.length
2893428934 sid = stmts[si]
@@ -29041,16 +29041,16 @@
2904129041 ybid_bp = @meth_body_ids[mi_bp]
2904229042 if ybid_bp >= 0
2904329043 arity_bp = method_yield_arity(mi_bp)
29044- ytypes_bp = "".split(",")
29044+ ytypes_bp = "".split(",", -1)
2904529045 ka_bp = 0
2904629046 while ka_bp < arity_bp
2904729047 ytypes_bp.push("")
2904829048 ka_bp = ka_bp + 1
2904929049 end
2905029050 push_scope
29051- yl_names_bp = "".split(",")
29052- yl_types_bp = "".split(",")
29053- scan_locals(ybid_bp, yl_names_bp, yl_types_bp, "".split(","))
29051+ yl_names_bp = "".split(",", -1)
29052+ yl_types_bp = "".split(",", -1)
29053+ scan_locals(ybid_bp, yl_names_bp, yl_types_bp, "".split(",", -1))
2905429054 yj_bp = 0
2905529055 while yj_bp < yl_names_bp.length
2905629056 declare_var(yl_names_bp[yj_bp], yl_types_bp[yj_bp])
@@ -29078,16 +29078,16 @@
2907829078 ybid_bp = @meth_body_ids[mi_bp]
2907929079 if ybid_bp >= 0
2908029080 arity_bp = method_yield_arity(mi_bp)
29081- ytypes_bp = "".split(",")
29081+ ytypes_bp = "".split(",", -1)
2908229082 ka_bp = 0
2908329083 while ka_bp < arity_bp
2908429084 ytypes_bp.push("")
2908529085 ka_bp = ka_bp + 1
2908629086 end
2908729087 push_scope
29088- yl_names_bp = "".split(",")
29089- yl_types_bp = "".split(",")
29090- scan_locals(ybid_bp, yl_names_bp, yl_types_bp, "".split(","))
29088+ yl_names_bp = "".split(",", -1)
29089+ yl_types_bp = "".split(",", -1)
29090+ scan_locals(ybid_bp, yl_names_bp, yl_types_bp, "".split(",", -1))
2909129091 yj_bp = 0
2909229092 while yj_bp < yl_names_bp.length
2909329093 declare_var(yl_names_bp[yj_bp], yl_types_bp[yj_bp])
@@ -29320,8 +29320,8 @@
2932029320 j = j + 1
2932129321 end
2932229322 # Pass 2: re-scan with vars declared
29323- lnames2 = "".split(",")
29324- ltypes2 = "".split(",")
29323+ lnames2 = "".split(",", -1)
29324+ ltypes2 = "".split(",", -1)
2932529325 scan_locals(bid, lnames2, ltypes2, params)
2932629326 j = 0
2932729327 while j < lnames2.length
@@ -29352,8 +29352,8 @@
2935229352 # set pp's scope to the merged type; redo scan_locals so the
2935329353 # `[]=` arm now sees pp resolved to its real type and re-picks
2935429354 # the right hash variant. Mirror the merge rules from pass 2.
29355- lnames3 = "".split(",")
29356- ltypes3 = "".split(",")
29355+ lnames3 = "".split(",", -1)
29356+ ltypes3 = "".split(",", -1)
2935729357 scan_locals(bid, lnames3, ltypes3, params)
2935829358 j = 0
2935929359 while j < lnames3.length
@@ -29407,7 +29407,7 @@
2940729407 j = 0
2940829408 while j < lnames.length
2940929409 if is_hash_type(ltypes[j]) == 1 && ltypes[j].include?("poly") == false
29410- obs_p5 = "".split(",")
29410+ obs_p5 = "".split(",", -1)
2941129411 collect_param_callee_slots(bid, lnames[j], obs_p5)
2941229412 cur_kt_p5 = hash_key_part(ltypes[j])
2941329413 agreed_p5 = ""
@@ -29495,8 +29495,8 @@
2949529495 while mi < @meth_names.length
2949629496 bid_h = @meth_body_ids[mi]
2949729497 if bid_h >= 0
29498- pnames = @meth_param_names[mi].split(",")
29499- ptypes = @meth_param_types[mi].split(",")
29498+ pnames = @meth_param_names[mi].split(",", -1)
29499+ ptypes = @meth_param_types[mi].split(",", -1)
2950029500 changed = 0
2950129501 pk = 0
2950229502 while pk < pnames.length
@@ -29520,7 +29520,7 @@
2952029520 while ci < @cls_names.length
2952129521 all_params = @cls_meth_params[ci].split("|", -1)
2952229522 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
29523- bodies = @cls_meth_bodies[ci].split(";")
29523+ bodies = @cls_meth_bodies[ci].split(";", -1)
2952429524 cls_changed = 0
2952529525 mj = 0
2952629526 while mj < all_params.length
@@ -29529,10 +29529,10 @@
2952929529 bid_c = bodies[mj].to_i
2953029530 end
2953129531 if bid_c >= 0
29532- cm_pnames = all_params[mj].split(",")
29533- cm_ptypes = "".split(",")
29532+ cm_pnames = all_params[mj].split(",", -1)
29533+ cm_ptypes = "".split(",", -1)
2953429534 if mj < all_ptypes.length
29535- cm_ptypes = all_ptypes[mj].split(",")
29535+ cm_ptypes = all_ptypes[mj].split(",", -1)
2953629536 end
2953729537 m_changed = 0
2953829538 pk2 = 0
@@ -29580,8 +29580,8 @@
2958029580 while mi < @meth_names.length
2958129581 bid_h = @meth_body_ids[mi]
2958229582 if bid_h >= 0
29583- pnames = @meth_param_names[mi].split(",")
29584- ptypes = @meth_param_types[mi].split(",")
29583+ pnames = @meth_param_names[mi].split(",", -1)
29584+ ptypes = @meth_param_types[mi].split(",", -1)
2958529585 each_widen_walk(bid_h, pnames, ptypes)
2958629586 end
2958729587 mi = mi + 1
@@ -29591,7 +29591,7 @@
2959129591 while ci < @cls_names.length
2959229592 all_params = @cls_meth_params[ci].split("|", -1)
2959329593 all_ptypes = @cls_meth_ptypes[ci].split("|", -1)
29594- bodies = @cls_meth_bodies[ci].split(";")
29594+ bodies = @cls_meth_bodies[ci].split(";", -1)
2959529595 mj = 0
2959629596 while mj < all_params.length
2959729597 bid_c = -1
@@ -29599,10 +29599,10 @@
2959929599 bid_c = bodies[mj].to_i
2960029600 end
2960129601 if bid_c >= 0
29602- cm_pnames = all_params[mj].split(",")
29603- cm_ptypes = "".split(",")
29602+ cm_pnames = all_params[mj].split(",", -1)
29603+ cm_ptypes = "".split(",", -1)
2960429604 if mj < all_ptypes.length
29605- cm_ptypes = all_ptypes[mj].split(",")
29605+ cm_ptypes = all_ptypes[mj].split(",", -1)
2960629606 end
2960729607 each_widen_walk(bid_c, cm_pnames, cm_ptypes)
2960829608 end
@@ -29615,7 +29615,7 @@
2961529615 while ci < @cls_names.length
2961629616 all_params = @cls_cmeth_params[ci].split("|", -1)
2961729617 all_ptypes = @cls_cmeth_ptypes[ci].split("|", -1)
29618- bodies = @cls_cmeth_bodies[ci].split(";")
29618+ bodies = @cls_cmeth_bodies[ci].split(";", -1)
2961929619 mj = 0
2962029620 while mj < all_params.length
2962129621 bid_c = -1
@@ -29623,10 +29623,10 @@
2962329623 bid_c = bodies[mj].to_i
2962429624 end
2962529625 if bid_c >= 0
29626- cm_pnames = all_params[mj].split(",")
29627- cm_ptypes = "".split(",")
29626+ cm_pnames = all_params[mj].split(",", -1)
29627+ cm_ptypes = "".split(",", -1)
2962829628 if mj < all_ptypes.length
29629- cm_ptypes = all_ptypes[mj].split(",")
29629+ cm_ptypes = all_ptypes[mj].split(",", -1)
2963029630 end
2963129631 each_widen_walk(bid_c, cm_pnames, cm_ptypes)
2963229632 end
@@ -29703,12 +29703,12 @@
2970329703 cls_name_w = @nd_name[recv_w]
2970429704 ci_w = find_class_idx(cls_name_w)
2970529705 if ci_w >= 0
29706- cm_names_w = @cls_cmeth_names[ci_w].split(";")
29706+ cm_names_w = @cls_cmeth_names[ci_w].split(";", -1)
2970729707 cmpall_w = @cls_cmeth_ptypes[ci_w].split("|", -1)
2970829708 cmi_w = 0
2970929709 while cmi_w < cm_names_w.length
2971029710 if cm_names_w[cmi_w] == mname_w && cmi_w < cmpall_w.length
29711- cmpt_w = cmpall_w[cmi_w].split(",")
29711+ cmpt_w = cmpall_w[cmi_w].split(",", -1)
2971229712 arg_ids_w = get_args(args_id_w)
2971329713 ai_w = 0
2971429714 changed_w = 0
@@ -29796,8 +29796,8 @@
2979629796 return ""
2979729797 end
2979829798 # Track all observed value types via a single string accumulator.
29799- val_types = "".split(",")
29800- key_types = "".split(",")
29799+ val_types = "".split(",", -1)
29800+ key_types = "".split(",", -1)
2980129801 collect_param_hash_writes(nid, pname, val_types, key_types)
2980229802 # also harvest signals from `pname.each do |k, v|`
2980329803 # block bodies. Programs that read-only-iterate the hash never
@@ -30093,9 +30093,9 @@
3009330093 # ---- Top-level main ----
3009430094 push_scope
3009530095 stmts = get_body_stmts(@root_id)
30096- ml = "".split(",")
30097- mt = "".split(",")
30098- empty_p = "".split(",")
30096+ ml = "".split(",", -1)
30097+ mt = "".split(",", -1)
30098+ empty_p = "".split(",", -1)
3009930099 refine_locals_multi_pass_full(stmts, ml, mt, empty_p, 1, 1)
3010030100 @nd_scope_names[@root_id] = ml.join("|")
3010130101 @nd_scope_types[@root_id] = mt.join("|")
@@ -30109,8 +30109,8 @@
3010930109 push_scope
3011030110 saved_method_name = @current_method_name
3011130111 @current_method_name = @meth_names[mi]
30112- pnames = @meth_param_names[mi].split(",")
30113- ptypes = @meth_param_types[mi].split(",")
30112+ pnames = @meth_param_names[mi].split(",", -1)
30113+ ptypes = @meth_param_types[mi].split(",", -1)
3011430114 pk = 0
3011530115 while pk < pnames.length
3011630116 if pnames[pk] != ""
@@ -30118,8 +30118,8 @@
3011830118 end
3011930119 pk = pk + 1
3012030120 end
30121- ml = "".split(",")
30122- mt = "".split(",")
30121+ ml = "".split(",", -1)
30122+ mt = "".split(",", -1)
3012330123 refine_method_body_locals(bid, ml, mt, pnames)
3012430124 @nd_scope_names[bid] = ml.join("|")
3012530125 @nd_scope_types[bid] = mt.join("|")
@@ -30134,7 +30134,7 @@
3013430134 while ci < @cls_names.length
3013530135 saved_ci = @current_class_idx
3013630136 @current_class_idx = ci
30137- bodies = @cls_meth_bodies[ci].split(";")
30137+ bodies = @cls_meth_bodies[ci].split(";", -1)
3013830138 bj = 0
3013930139 while bj < bodies.length
3014030140 bid = bodies[bj].to_i
@@ -30151,8 +30151,8 @@
3015130151 declare_var(pnames2[pk], pt)
3015230152 pk = pk + 1
3015330153 end
30154- ml2 = "".split(",")
30155- mt2 = "".split(",")
30154+ ml2 = "".split(",", -1)
30155+ mt2 = "".split(",", -1)
3015630156 refine_method_body_locals(bid, ml2, mt2, pnames2)
3015730157 @nd_scope_names[bid] = ml2.join("|")
3015830158 @nd_scope_types[bid] = mt2.join("|")
@@ -30160,8 +30160,8 @@
3016030160 end
3016130161 bj = bj + 1
3016230162 end
30163- cm_bodies = @cls_cmeth_bodies[ci].split(";")
30164- cm_names = @cls_cmeth_names[ci].split(";")
30163+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
30164+ cm_names = @cls_cmeth_names[ci].split(";", -1)
3016530165 saved_meth = @current_method_name
3016630166 # Build per-(ci, cmj) scope tables alongside the per-bid
3016730167 # @nd_scope_names entry. Inherited cmeths share their body id
@@ -30170,8 +30170,8 @@
3017030170 # leaving every other subclass with the wrong LV types — see
3017130171 # Comment.find returning sp_Article *). Per-(ci, cmj) keeps
3017230172 # each subclass's specialized result alive for codegen.
30173- cms_per_ci = "".split(",")
30174- cmt_per_ci = "".split(",")
30173+ cms_per_ci = "".split(",", -1)
30174+ cmt_per_ci = "".split(",", -1)
3017530175 cbj = 0
3017630176 while cbj < cm_bodies.length
3017730177 cbid = cm_bodies[cbj].to_i
@@ -30193,8 +30193,8 @@
3019330193 declare_var(cpnames[cpk], cpt)
3019430194 cpk = cpk + 1
3019530195 end
30196- cml = "".split(",")
30197- cmt = "".split(",")
30196+ cml = "".split(",", -1)
30197+ cmt = "".split(",", -1)
3019830198 refine_method_body_locals(cbid, cml, cmt, cpnames)
3019930199 @nd_scope_names[cbid] = cml.join("|")
3020030200 @nd_scope_types[cbid] = cmt.join("|")
@@ -30262,7 +30262,7 @@
3026230262 # their typed slots, then refine body locals with those names
3026330263 # excluded from the rescan so reassigns hit the param slot
3026430264 # rather than inventing a fresh local of the RHS type.
30265- ie_pnames = "".split(",")
30265+ ie_pnames = "".split(",", -1)
3026630266 spn_iv = ""
3026730267 if iv < @ieval_self_param_names.length
3026830268 spn_iv = @ieval_self_param_names[iv]
@@ -30275,9 +30275,9 @@
3027530275 if iv < @ieval_extra_param_names.length
3027630276 extra_iv_csv = @ieval_extra_param_names[iv]
3027730277 end
30278- extra_iv_names = "".split(",")
30278+ extra_iv_names = "".split(",", -1)
3027930279 if extra_iv_csv != ""
30280- extra_iv_names = extra_iv_csv.split(";")
30280+ extra_iv_names = extra_iv_csv.split(";", -1)
3028130281 end
3028230282 kex_iv = 0
3028330283 while kex_iv < extra_iv_names.length
@@ -30285,12 +30285,12 @@
3028530285 ie_pnames.push(extra_iv_names[kex_iv])
3028630286 kex_iv = kex_iv + 1
3028730287 end
30288- ml_iv = "".split(",")
30289- mt_iv = "".split(",")
30288+ ml_iv = "".split(",", -1)
30289+ mt_iv = "".split(",", -1)
3029030290 refine_method_body_locals(bid_iv, ml_iv, mt_iv, ie_pnames)
3029130291 # Order: self-bound at slot 0, extras, then body locals.
30292- final_names = "".split(",")
30293- final_types = "".split(",")
30292+ final_names = "".split(",", -1)
30293+ final_types = "".split(",", -1)
3029430294 if spn_iv != ""
3029530295 final_names.push(spn_iv)
3029630296 final_types.push("obj_" + @cls_names[@ieval_class_idxs[iv]])
@@ -30342,7 +30342,7 @@
3034230342 end
3034330343 if body_bn >= 0
3034430344 # Collect syntactic block param names
30345- bp_list = "".split(",")
30345+ bp_list = "".split(",", -1)
3034630346 params_n = @nd_parameters[bn]
3034730347 if params_n >= 0
3034830348 inner_p = @nd_parameters[params_n]
@@ -30362,8 +30362,8 @@
3036230362 end
3036330363 end
3036430364 end
30365- bn_names = "".split(",")
30366- bn_types = "".split(",")
30365+ bn_names = "".split(",", -1)
30366+ bn_types = "".split(",", -1)
3036730367 scan_locals(body_bn, bn_names, bn_types, bp_list)
3036830368 @nd_scope_names[body_bn] = bn_names.join("|")
3036930369 @nd_scope_types[body_bn] = bn_types.join("|")
@@ -30377,9 +30377,9 @@
3037730377 # ---- Top-level (main) ----
3037830378 stmts = get_body_stmts(@root_id)
3037930379 push_scope
30380- empty_p = "".split(",")
30381- ml = "".split(",")
30382- mt = "".split(",")
30380+ empty_p = "".split(",", -1)
30381+ ml = "".split(",", -1)
30382+ mt = "".split(",", -1)
3038330383 refine_locals_multi_pass_full(stmts, ml, mt, empty_p, 1, 1)
3038430384 si = 0
3038530385 while si < stmts.length
@@ -30396,8 +30396,8 @@
3039630396 push_scope
3039730397 saved_method_name = @current_method_name
3039830398 @current_method_name = @meth_names[mi]
30399- pnames = @meth_param_names[mi].split(",")
30400- ptypes = @meth_param_types[mi].split(",")
30399+ pnames = @meth_param_names[mi].split(",", -1)
30400+ ptypes = @meth_param_types[mi].split(",", -1)
3040130401 pk = 0
3040230402 while pk < pnames.length
3040330403 if pnames[pk] != ""
@@ -30405,8 +30405,8 @@
3040530405 end
3040630406 pk = pk + 1
3040730407 end
30408- lnames = "".split(",")
30409- ltypes = "".split(",")
30408+ lnames = "".split(",", -1)
30409+ ltypes = "".split(",", -1)
3041030410 refine_method_body_locals(bid, lnames, ltypes, pnames)
3041130411 walk_and_cache(bid)
3041230412 @current_method_name = saved_method_name
@@ -30420,7 +30420,7 @@
3042030420 while ci < @cls_names.length
3042130421 saved_ci = @current_class_idx
3042230422 @current_class_idx = ci
30423- bodies = @cls_meth_bodies[ci].split(";")
30423+ bodies = @cls_meth_bodies[ci].split(";", -1)
3042430424 bj = 0
3042530425 while bj < bodies.length
3042630426 bid = bodies[bj].to_i
@@ -30437,16 +30437,16 @@
3043730437 declare_var(pnames2[pk], pt)
3043830438 pk = pk + 1
3043930439 end
30440- ml2 = "".split(",")
30441- mt2 = "".split(",")
30440+ ml2 = "".split(",", -1)
30441+ mt2 = "".split(",", -1)
3044230442 refine_method_body_locals(bid, ml2, mt2, pnames2)
3044330443 walk_and_cache(bid)
3044430444 pop_scope
3044530445 end
3044630446 bj = bj + 1
3044730447 end
30448- cm_bodies = @cls_cmeth_bodies[ci].split(";")
30449- cm_names = @cls_cmeth_names[ci].split(";")
30448+ cm_bodies = @cls_cmeth_bodies[ci].split(";", -1)
30449+ cm_names = @cls_cmeth_names[ci].split(";", -1)
3045030450 saved_meth = @current_method_name
3045130451 cbj = 0
3045230452 while cbj < cm_bodies.length
@@ -30467,8 +30467,8 @@
3046730467 declare_var(cpnames[cpk], cpt)
3046830468 cpk = cpk + 1
3046930469 end
30470- cml = "".split(",")
30471- cmt = "".split(",")
30470+ cml = "".split(",", -1)
30471+ cmt = "".split(",", -1)
3047230472 refine_method_body_locals(cbid, cml, cmt, cpnames)
3047330473 walk_and_cache(cbid)
3047430474 pop_scope