diff options
author | Sergio Campama <kaipi@google.com> | 2016-08-30 11:55:49 -0700 |
---|---|---|
committer | Sergio Campama <kaipi@google.com> | 2016-09-20 17:59:27 -0700 |
commit | 1af7c4cb08defd2521d8552fd148932da08b2c46 (patch) | |
tree | a922cd934b5b7b72ff6318aeffa9a27b9310c0f1 /src/google/protobuf/util | |
parent | 4f379f81cef4dd8e005fd0bcc9199bf842fc35d4 (diff) |
Fixes static analyzer issues from xcode.
Diffstat (limited to 'src/google/protobuf/util')
3 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/util/internal/default_value_objectwriter.cc b/src/google/protobuf/util/internal/default_value_objectwriter.cc index fa31f763..3479949b 100644 --- a/src/google/protobuf/util/internal/default_value_objectwriter.cc +++ b/src/google/protobuf/util/internal/default_value_objectwriter.cc @@ -586,7 +586,6 @@ void DefaultValueObjectWriter::RenderDataPiece(StringPiece name, new Node(name.ToString(), NULL, PRIMITIVE, data, false, child == NULL ? current_->path() : child->path(), suppress_empty_list_, field_scrub_callback_.get())); - child = node.get(); current_->AddChild(node.release()); } else { child->set_data(data); diff --git a/src/google/protobuf/util/internal/json_stream_parser.cc b/src/google/protobuf/util/internal/json_stream_parser.cc index 39be7b03..be51ce56 100644 --- a/src/google/protobuf/util/internal/json_stream_parser.cc +++ b/src/google/protobuf/util/internal/json_stream_parser.cc @@ -315,7 +315,6 @@ util::Status JsonStreamParser::ParseStringHelper() { // We're about to handle an escape, copy all bytes from last to data. if (last < data) { parsed_storage_.append(last, data - last); - last = data; } // If we ran out of string after the \, cancel or report an error // depending on if we expect more data later. @@ -371,7 +370,6 @@ util::Status JsonStreamParser::ParseStringHelper() { } else { if (last < data) { parsed_storage_.append(last, data - last); - last = data; } parsed_ = StringPiece(parsed_storage_); } diff --git a/src/google/protobuf/util/message_differencer.cc b/src/google/protobuf/util/message_differencer.cc index 03a334b6..328b40d8 100644 --- a/src/google/protobuf/util/message_differencer.cc +++ b/src/google/protobuf/util/message_differencer.cc @@ -626,6 +626,7 @@ bool MessageDifferencer::CompareWithFieldsInternal( } if (reporter_ != NULL) { + assert(field1 != NULL); int count = field1->is_repeated() ? reflection1->FieldSize(message1, field1) : 1; @@ -706,6 +707,7 @@ bool MessageDifferencer::CompareWithFieldsInternal( } bool fieldDifferent = false; + assert(field1 != NULL); if (field1->is_repeated()) { fieldDifferent = !CompareRepeatedField(message1, message2, field1, parent_fields); @@ -875,6 +877,7 @@ bool MessageDifferencer::CompareRepeatedField( for (int i = 0; i < count1; ++i) { if (match_list1[i] != -1) continue; + assert(reporter_ != NULL); specific_field.index = i; parent_fields->push_back(specific_field); reporter_->ReportDeleted(message1, message2, *parent_fields); |