aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul-Antoine Arras <parras@baylibre.com>2025-01-31 11:41:47 +0100
committerPaul-Antoine Arras <parras@baylibre.com>2025-01-31 16:46:12 +0100
commitaf51fe9593ec0e9373f8a453bab2129a48193a44 (patch)
treeb7abf745a0124b88d9938cad9c053042e5a642e2 /gcc
parent0d97700443b45b947eda40dac7cf4d0397770b87 (diff)
downloadgcc-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.cc5
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