diff --git a/regression/goto-instrument/nondet-volatile-01/test.c b/regression/goto-instrument/nondet-volatile-01/test.c index ec0cc273a79b..3808748b6979 100644 --- a/regression/goto-instrument/nondet-volatile-01/test.c +++ b/regression/goto-instrument/nondet-volatile-01/test.c @@ -1,5 +1,15 @@ #include +enum E +{ + A, + B +}; + +int main() +{ +} + void main() { int a[2] = {0}; @@ -8,4 +18,8 @@ void main() a[i] = 1; assert(a[1] == 0); // should fail + + // make sure the use of enum (tags) does not cause infinite recursion + enum A a = A; + a = a; } diff --git a/src/util/namespace.cpp b/src/util/namespace.cpp index fcdf4b1465bd..91d6537fbe49 100644 --- a/src/util/namespace.cpp +++ b/src/util/namespace.cpp @@ -54,6 +54,9 @@ const typet &namespace_baset::follow(const typet &src) const if(src.id() == ID_struct_tag) return follow_tag(to_struct_tag_type(src)); + if(src.id() == ID_c_enum_tag) + return follow_tag(to_c_enum_tag_type(src)); + return src; }