Skip to content

Commit

Permalink
Workaround apparent UB in ifstream assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyelewis committed May 22, 2021
1 parent 3c2e734 commit 7a40e74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/ct_common/cath/common/file/path_or_istream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ path_or_istream & path_or_istream::set_path(const path &prm_file ///< The path t
) {
if ( input_file_stream ) {
input_file_stream->close();

// https://bugs.llvm.org/show_bug.cgi?id=50445
input_file_stream.reset();
}
if ( prm_file != get_flag() || ! standard_instream ) {
input_file_stream = open_ifstream( prm_file );
Expand Down

0 comments on commit 7a40e74

Please sign in to comment.