diff options
author | Paul-Antoine Arras <parras@baylibre.com> | 2025-01-31 11:41:47 +0100 |
---|---|---|
committer | Paul-Antoine Arras <parras@baylibre.com> | 2025-01-31 16:46:12 +0100 |
commit | af51fe9593ec0e9373f8a453bab2129a48193a44 (patch) | |
tree | b7abf745a0124b88d9938cad9c053042e5a642e2 /gcc | |
parent | 0d97700443b45b947eda40dac7cf4d0397770b87 (diff) | |
download | gcc-af51fe9593ec0e9373f8a453bab2129a48193a44.zip gcc-af51fe9593ec0e9373f8a453bab2129a48193a44.tar.gz gcc-af51fe9593ec0e9373f8a453bab2129a48193a44.tar.bz2 |
OpenMP/Fortran: Add missing pop_state in parse_omp_dispatch [PR118714]
When the ST_NONE case is taken, the function returns immediately. Not calling
pop_state causes a dangling pointer.
PR fortran/118714
gcc/fortran/ChangeLog:
* parse.cc (parse_omp_dispatch): Add missing pop_state.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/parse.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc index 00cd23d..5094d9d 100644 --- a/gcc/fortran/parse.cc +++ b/gcc/fortran/parse.cc @@ -6375,7 +6375,10 @@ parse_omp_dispatch (void) st = next_statement (); if (st == ST_NONE) - return st; + { + pop_state (); + return st; + } if (st == ST_CALL || st == ST_ASSIGNMENT) accept_statement (st); else |