]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/analyzer/region-model-manager.h
analyzer: Fix regression bug after r14-1632-g9589a46ddadc8b [PR110198]
authorbenjamin priour <priour.be@gmail.com>
Thu, 22 Jun 2023 19:39:05 +0000 (21:39 +0200)
committerbenjamin priour <vultkayn@gcc.gnu.org>
Thu, 29 Jun 2023 23:32:47 +0000 (01:32 +0200)
commit1eb90f46c16453f72dc119ba20b07053a15b452d
treeb1448d54724083dc2a03768d950279edffcc331d
parent9dc18fca431626404b0692c689a2e103666e7adb
analyzer: Fix regression bug after r14-1632-g9589a46ddadc8b [PR110198]

g++.dg/analyzer/PR100244.C was failing after a patch of PR109439.
The reason was a spurious preemptive return of get_store_value upon
out-of-bounds read that was preventing further checks. Now instead,
a boolean value check_poisoned goes to false when a OOB is detected,
and is later on given to get_or_create_initial_value.

gcc/analyzer/ChangeLog:
PR analyzer/110198
* region-model-manager.cc
(region_model_manager::get_or_create_initial_value): Take an
optional boolean value to bypass poisoning checks
* region-model-manager.h: Update declaration of the above function.
* region-model.cc (region_model::get_store_value): No longer returns
on OOB, but rather gives a boolean to get_or_create_initial_value.
(region_model::check_region_access): Update docstring.
(region_model::check_region_for_write): Update docstring.

Signed-off-by: benjamin priour <priour.be@gmail.com>
gcc/analyzer/region-model-manager.cc
gcc/analyzer/region-model-manager.h
gcc/analyzer/region-model.cc