Skip to content

Commit ae8aca2

Browse files
committed
Fix casting away const in exception_listt
`find` always returns a const reference. Therefore we need to use `add`, to get a mutable reference instead. Otherwise the `.get_sub()` may yield the global empty sub instead of a freshly allocated one.
1 parent a531056 commit ae8aca2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/std_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,7 @@ class code_push_catcht:public codet
18581858
}
18591859

18601860
exception_listt &exception_list() {
1861-
return (exception_listt &)find(ID_exception_list).get_sub();
1861+
return (exception_listt &)add(ID_exception_list).get_sub();
18621862
}
18631863

18641864
const exception_listt &exception_list() const {

0 commit comments

Comments
 (0)