Skip to content

Commit

Permalink
fix a bug in merging union facts of a dereferenced pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuejun Yang committed Jul 24, 2011
1 parent 24013d2 commit cc2104f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/FactUnion.cpp
Expand Up @@ -245,6 +245,8 @@ FactUnion::join_var_facts(const vector<const Fact*>& facts, const vector<const V
if (fu == 0) {
fu = dynamic_cast<FactUnion*>(exist_fact->clone());
} else {
// hack: both facts have to be the property of the same variable to be able to merge
fu->set_var(exist_fact->get_var());
fu->join(*exist_fact);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/FactUnion.h
Expand Up @@ -57,6 +57,7 @@ class FactUnion : public Fact
virtual ~FactUnion(void) {};

virtual const Variable* get_var(void) const { return var;};
void set_var(const Variable* v) { var = v;}
const Type* get_last_written_type(void) const;
int get_last_written_fid(void) const { return last_written_fid; };
static bool is_field_readable(const Variable* v, int fid, const vector<const Fact*>& facts);
Expand Down

0 comments on commit cc2104f

Please sign in to comment.