aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2015-04-01 18:27:15 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2015-04-01 18:27:15 +0200
commit68e2ce02f8d69b26c9cea6e0d338f855cbea3ace (patch)
tree98acb09c398112bff31ce34c0857aa0f4e9b8e23 /backend
parent5d6febecb8c0f90a627033744f6f62164645a1a4 (diff)
parentdaccc2928e6410c4e8c886ea7d019fd9a071b931 (diff)
downloadcompcert-68e2ce02f8d69b26c9cea6e0d338f855cbea3ace.tar.gz
compcert-68e2ce02f8d69b26c9cea6e0d338f855cbea3ace.zip
Merge pull request #31 from AbsInt/null-ptr-cmp
Revised semantics of comparisons between a pointer and 0.
Diffstat (limited to 'backend')
-rw-r--r--backend/Selectionproof.v2
-rw-r--r--backend/ValueDomain.v6
2 files changed, 5 insertions, 3 deletions
diff --git a/backend/Selectionproof.v b/backend/Selectionproof.v
index bb9bd592..20b6cf93 100644
--- a/backend/Selectionproof.v
+++ b/backend/Selectionproof.v
@@ -135,7 +135,7 @@ Proof.
inv H. econstructor; eauto.
(* default *)
econstructor. constructor. eauto. constructor.
- simpl. inv H0. auto. auto.
+ simpl. inv H0. auto.
Qed.
Lemma eval_load:
diff --git a/backend/ValueDomain.v b/backend/ValueDomain.v
index 92004a2f..ff3ccfa1 100644
--- a/backend/ValueDomain.v
+++ b/backend/ValueDomain.v
@@ -2121,12 +2121,14 @@ Proof.
assert (IP: forall i b ofs,
cmatch (Val.cmpu_bool valid c (Vint i) (Vptr b ofs)) (cmp_different_blocks c)).
{
- intros. simpl. destruct (Int.eq i Int.zero). apply cmp_different_blocks_sound. apply cmp_different_blocks_none.
+ intros. simpl. destruct (Int.eq i Int.zero && (valid b (Int.unsigned ofs) || valid b (Int.unsigned ofs - 1))).
+ apply cmp_different_blocks_sound. apply cmp_different_blocks_none.
}
assert (PI: forall i b ofs,
cmatch (Val.cmpu_bool valid c (Vptr b ofs) (Vint i)) (cmp_different_blocks c)).
{
- intros. simpl. destruct (Int.eq i Int.zero). apply cmp_different_blocks_sound. apply cmp_different_blocks_none.
+ intros. simpl. destruct (Int.eq i Int.zero && (valid b (Int.unsigned ofs) || valid b (Int.unsigned ofs - 1))).
+ apply cmp_different_blocks_sound. apply cmp_different_blocks_none.
}
unfold cmpu_bool; inversion H; subst; inversion H0; subst;
auto using cmatch_top, cmp_different_blocks_none, pcmp_none,