Commit de3494fe authored by xiaofeng@google.com's avatar xiaofeng@google.com

Fix issue 403, issue 456, issue 462

parent e406747c
...@@ -88,6 +88,12 @@ void ServiceGenerator::Generate(io::Printer* printer) { ...@@ -88,6 +88,12 @@ void ServiceGenerator::Generate(io::Printer* printer) {
GenerateStub(printer); GenerateStub(printer);
GenerateBlockingStub(printer); GenerateBlockingStub(printer);
// Add an insertion point.
printer->Print(
"\n"
"// @@protoc_insertion_point(class_scope:$full_name$)\n",
"full_name", descriptor_->full_name());
printer->Outdent(); printer->Outdent();
printer->Print("}\n\n"); printer->Print("}\n\n");
} }
......
...@@ -50,8 +50,12 @@ inline bool CodedInputStream::InternalReadStringInline(string* buffer, ...@@ -50,8 +50,12 @@ inline bool CodedInputStream::InternalReadStringInline(string* buffer,
if (BufferSize() >= size) { if (BufferSize() >= size) {
STLStringResizeUninitialized(buffer, size); STLStringResizeUninitialized(buffer, size);
memcpy(string_as_array(buffer), buffer_, size); // When buffer is empty, string_as_array(buffer) will return NULL but memcpy
Advance(size); // requires non-NULL pointers even when size is 0. Hench this check.
if (size > 0) {
memcpy(string_as_array(buffer), buffer_, size);
Advance(size);
}
return true; return true;
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
// Based on original Protocol Buffers design by // Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others. // Sanjay Ghemawat, Jeff Dean, and others.
#include <iostream> #include <istream>
#include <stack> #include <stack>
#include <google/protobuf/stubs/hash.h> #include <google/protobuf/stubs/hash.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment