Skip to content

Commit 6c8adc3

Browse files
committed
Fix memory leak in ansi-c frontend
If you swap an irep with an irep that it contains, I think it creates a circular reference which lives until the program quits.
1 parent 5813937 commit 6c8adc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ansi-c/c_typecheck_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void c_typecheck_baset::typecheck_type(typet &type)
5454
exprt alignment=static_cast<const exprt &>(type.find(ID_C_alignment));
5555
irept _typedef=type.find(ID_C_typedef);
5656

57-
type.swap(type.subtype());
57+
type=type.subtype();
5858

5959
c_qualifiers.write(type);
6060
if(packed)

0 commit comments

Comments
 (0)