Commit 1589b1d8 authored by temporal's avatar temporal

Fix startup crash when statically linking on Mac.

parent c5ff06cc
...@@ -57,7 +57,10 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile( ...@@ -57,7 +57,10 @@ bool SimpleDescriptorDatabase::DescriptorIndex<Value>::AddFile(
return false; return false;
} }
string path = file.package(); // We must be careful here -- calling file.package() if file.has_package() is
// false could access an uninitialized static-storage variable if we are being
// run at startup time.
string path = file.has_package() ? file.package() : string();
if (!path.empty()) path += '.'; if (!path.empty()) path += '.';
for (int i = 0; i < file.message_type_size(); i++) { for (int i = 0; i < file.message_type_size(); i++) {
......
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