stack-protector: Check stack canary before throwing exception
commita25982ada523689c8745d7fb4b1b93c8f5dab2e7
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 14 Jul 2022 15:23:38 +0000 (14 08:23 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 28 Sep 2022 01:29:20 +0000 (27 18:29 -0700)
tree574019090f42888a84404da6ca7b37fa4c6da68d
parent28390443ff72039ee8215fef2560fe76690af155
stack-protector: Check stack canary before throwing exception

Check stack canary before throwing exception to avoid stack corruption.

gcc/

PR middle-end/58245
* calls.cc: Include "tree-eh.h".
(expand_call): Check stack canary before throwing exception.

gcc/testsuite/

PR middle-end/58245
* g++.dg/fstack-protector-strong.C: Adjusted.
* g++.dg/pr58245-1.C: New test.
gcc/calls.cc
gcc/testsuite/g++.dg/fstack-protector-strong.C
gcc/testsuite/g++.dg/pr58245-1.C [new file with mode: 0644]