Skip to content

Deeply nested object causes stack overflow error on compile #1070

@jeffcharles

Description

@jeffcharles

This JS seems to cause a Wasm-level stack overflow error when run with javy build:

let foo = {"":[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"0":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":[],"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[[[null,[[{},"",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[1.2681253932520594e-233,["",[],[],[{},[[],[-5102808638908533466,{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{}},"\n\n;":[[],[[],[[").","",[],[],null,{},[[],[[[],[],[[],[[{},[{},[],[],[{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":{"":""}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}},"\n\u000f)":[]}]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]};

This behaviour reproduces on v7.0.1 and main. The JS runs correctly when executed with NodeJS. The context is I tried using the fuzzer and it found this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions