Skip to content

Commit

Permalink
Cherry pick PR #2205: Fix uninitialized variable append_ in class con…
Browse files Browse the repository at this point in the history
…structors (#2358)

Refer to the original PR: #2205

b/219048469

Test-On-Device: true

Co-authored-by: alexanderbobrovnik <[email protected]>
  • Loading branch information
1 parent 9209c19 commit 2b106b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 2b106b7

Please sign in to comment.