Summary: When we make the decision to go into a branch "v = N" where some abstract value is compared to a constant, remember the corresponding equality. This allows to prune simple infeasible paths intra-procedurally. Further work is needed to make this useful interprocedurally, for instance either or both of these ideas could be explored: - abduce v=N in the precondition and do not apply summaries when the equalities in the pre are not satisfied - prune post-conditions that lead to unsat states where a value has to be equal to several different constants Reviewed By: skcho Differential Revision: D17906166 fbshipit-source-id: 5cc84abc2master
parent
3ac8e27062
commit
96c96a8dc6
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
void unreachable_eq_then_ne_ok(int* x, int y) {
|
||||
if (y == 0) {
|
||||
free(x);
|
||||
}
|
||||
if (y != 0) {
|
||||
free(x);
|
||||
}
|
||||
}
|
||||
|
||||
// pulse only tracks equality for now, not disequality
|
||||
void FP_unreachable_ne_then_eq_ok(int* x, int y) {
|
||||
if (y != 0) {
|
||||
free(x);
|
||||
}
|
||||
if (y == 0) {
|
||||
free(x);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue