This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/79992] accessing storage member of lambda via pointer with -no-pie causes the next function to overwrite the pointer's data


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79992

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---

static auto get_wrapped_number() {
    return [i = 1] { return &i; };
}

This seems like you could reference a variable which has gone out of scope.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]