Skip to content

Stack overflow on long expressions #2340

@aleksisch

Description

@aleksisch

We may get stackoverflow on things like this (this example from ASAN build, you need more ? to reproduce in Release):

 tuple var1{
}
 enum var3: uint16 {
var3,var2=var3(var1 :=  -- +~9 --  >>>  false .[ new < tuple <var3: block < variant <var2: block ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????;
var2: array < function -#>&,var1: auto -& ?? > ?? >>>(var2=0). int8 () is var1] is  urange )}

[export]
def main{
var3 -> print("OOOOOO{-7}");}

Same for exprs like a==null==null==null==....

This can lead to security issues caused by stackoverflow. I think correct fix will be to set ast infer depth limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions