Skip to content

[flang][OpenMP] Initialize variables of omp_nest_lock_kind to a known bad value (e.g., -1) #152174

@eugeneepshteyn

Description

@eugeneepshteyn

Currently, if one declares an automatic variable of type integer(kind=omp_nest_lock_kind) and forgets to call omp_init_nest_lock(), and then proceeds to call omp_destroy_nest_lock(), there's a crash due to uninitialized nest lock variable.

Would it be possible to detect that instantiations of integer variables of omp_nest_lock_kind kind and always initialize them to some known bad value (e.g., -1)? This would allow displaying useful runtime error, instead of just crash.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions