]> git.ipfire.org Git - people/ms/gcc.git/commit
asan: Fix up error recovery for too large frames [PR107317]
authorJakub Jelinek <jakub@redhat.com>
Thu, 24 Nov 2022 10:29:54 +0000 (11:29 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 10 Feb 2023 12:38:43 +0000 (13:38 +0100)
commitff185dd96ac4576e722b39fc0f7026281de06eb2
tree798515afe3a63173486eb8e809445ad14412b3f1
parent80010acd052ca7fe544740144756cf9fc2fad629
asan: Fix up error recovery for too large frames [PR107317]

asan_emit_stack_protection and functions it calls have various asserts that
verify sanity of the stack protection instrumentation.  But, that
verification can easily fail if we've diagnosed a frame offset overflow.
asan_emit_stack_protection just emits some extra code in the prologue,
if we've reported errors, we aren't producing assembly, so it doesn't
really matter if we don't include the protection code, compilation
is going to fail anyway.

2022-11-24  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/107317
* asan.cc: Include diagnostic-core.h.
(asan_emit_stack_protection): Return NULL early if seen_error ().

* gcc.dg/asan/pr107317.c: New test.

(cherry picked from commit b6330a7685476fc30b8ae9bbf3fca1a9b0d4be95)
gcc/asan.cc
gcc/testsuite/gcc.dg/asan/pr107317.c [new file with mode: 0644]