aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/mem2reg/address-used00.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-09 12:19:57 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-11 13:59:08 +0100
commitb24289d4b62a73a7de9c5b9dd8780da96ec58bf4 (patch)
tree7845eddb7314a7f39c97a26fc63a2b15488f3291 /validation/mem2reg/address-used00.c
parent2ae43367d11e80ec4bdbd56aeaa0eb6141bfd326 (diff)
downloadsparse-dev-b24289d4b62a73a7de9c5b9dd8780da96ec58bf4.tar.gz
fix address_taken()
The function address_taken() check that the address of a variable is not used for anything else than for doing a memory access. If the function fails, it means that the address can escape and thus can be used to modify the variable indirectly and the memop simplification would then be unsafe. The function do this check by assuming that any uses by an instruction other than a load or a store can escape the address, which is true. However it doesn't take in account that if the variable's address is used, not as the address of a store, but as the value stored, then this address also escape. Fix this by adding a check that the use of the variable's address is effectively done as the address of stores & loads and not as the value stored by the memop. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/mem2reg/address-used00.c')
-rw-r--r--validation/mem2reg/address-used00.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/mem2reg/address-used00.c b/validation/mem2reg/address-used00.c
index f2d6c87b..1501bc1c 100644
--- a/validation/mem2reg/address-used00.c
+++ b/validation/mem2reg/address-used00.c
@@ -13,7 +13,6 @@ int foo(int **g, int j)
/*
* check-name: address-used00
* check-command: test-linearize -Wno-decl -fdump-ir=final $file
- * check-known-to-fail
* check-output-ignore
* check-output-excludes: ret\\..* \\$1
*/