summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-13 21:21:53 -0700
committerOri Bernstein <ori@eigenstate.org>2017-08-13 21:22:10 -0700
commit137b08b71982b6c82921b9ece97240da4890bf23 (patch)
tree4a86683f1cd96a7768d753df482893d011e9a93e /parse
parent433606f675efdaa466b7e9ab8adb257999af5ae6 (diff)
downloadmc-137b08b71982b6c82921b9ece97240da4890bf23.tar.gz
Types are also equal with flipflopping.
If we have types a -> b -> ptr -> a, and b -> a -> ptr -> b, there are cases where the two types can end up on different branches, so we end up flipflopping between avisited and bvisited containing the type we want.
Diffstat (limited to 'parse')
-rw-r--r--parse/type.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse/type.c b/parse/type.c
index 485f6b3..55885ca 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -763,6 +763,7 @@ int
tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
{
Type *x, *y;
+ int atid, btid;
size_t i;
int ret;
@@ -786,9 +787,13 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
if (bshas(avisited, a->tid) && bshas(bvisited, b->tid))
return 1;
+ if (bshas(bvisited, a->tid) && bshas(avisited, b->tid))
+ return 1;
bsput(avisited, a->tid);
bsput(bvisited, b->tid);
+ atid = a->tid;
+ btid = b->tid;
ret = 1;
switch (a->type) {