]> git.lizzy.rs Git - rust.git/commit
Initialize all constraints to False
authorTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 5 Aug 2011 22:23:44 +0000 (15:23 -0700)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 5 Aug 2011 22:25:52 +0000 (15:25 -0700)
commit1c786bcc82424b9218f1ca52fa99a12ce353e590
tree880c3f8d01ec2d6652b78f2d65a60ce55d032cd3
parente76efbc43a39ad035a29d6e1abc2a86b16123a03
Initialize all constraints to False

Previously, typestate was initializing the init constraint for
a declared-but-not-initialized variable (like x in "let x;") to False,
but other constraints to Don't-know. This led to over-lenient results
when a variable was used before declaration (see the included test
case). Now, everything gets initialized to False in the prestate/poststate-
finding phase, and Don't-know should only be used in pre/postconditions.

This aspect of the algorithm really needs formalization (just on paper),
but for now, this closes #700
src/comp/middle/tstate/bitvectors.rs
src/comp/middle/tstate/states.rs
src/comp/middle/tstate/tritv.rs
src/test/compile-fail/alt-join.rs [new file with mode: 0644]