mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 22:45:47 +00:00
`target.push(...items)` passes every item as a call argument and overflows the stack once a target-sized array grows past the engine's argument limit. This class was fixed one site at a time in #10304, #10343, #10362 and #8632. Add one shared appendAll helper in src/domain and use it at the remaining sites whose arrays grow with the input: XML member counting, app-task row suggestions, native call routes and unresolved calls, call-path caveats, environment-manifest merges, reference-source import entries, dyld trace edges and JS symbolic flow values. The web bundle merge from the previous commit now uses the shared helper too. Bounded spreads (fixed literals, page-sized reads) are left as they are. Refs #10445 Refs #10342 Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
10 lines
366 B
TypeScript
10 lines
366 B
TypeScript
/**
|
|
* Append every item in order. `target.push(...items)` passes each item as a
|
|
* call argument, which overflows the stack once a target-sized array grows
|
|
* past the engine's argument limit; this loop has no such limit.
|
|
*/
|
|
export const appendAll = <T>(target: T[], items: Iterable<T>): T[] => {
|
|
for (const item of items) target.push(item);
|
|
return target;
|
|
};
|