Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialized variable append_ in class constructors #2205

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion base/files/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ File::File(File&& other)
tracing_path_(other.tracing_path_),
error_details_(other.error_details()),
created_(other.created()),
async_(other.async_) {}
async_(other.async_)
#if defined(STARBOARD)
,
append_(other.append_)
#endif
{
}

File::~File() {
// Go through the AssertIOAllowed logic.
Expand All @@ -78,6 +84,9 @@ File& File::operator=(File&& other) {
error_details_ = other.error_details();
created_ = other.created();
async_ = other.async_;
#if defined(STARBOARD)
append_ = other.append_;
#endif
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion base/files/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class BASE_EXPORT File {
bool async_;

#if defined(STARBOARD)
bool append_;
bool append_ = false;
#endif

DISALLOW_COPY_AND_ASSIGN(File);
Expand Down
Loading