[roll] Roll fuchsia [weavestack] Avoid accessing uninitialized memory
... when converting between the various FIDL enums and Strings.
Strict FIDL enums are represented by a C++ "Enum Class". Traditionally,
enum classes are restricted to their fixed set of declared values;
however, they can also be zero-initialized using
"FooEnumClass my_enum = {}` syntax. This allows instances of the enum
class to exist outside of the set of declared values.
This leads to an unfortunate gap in the C++ compiler when writing a
function that switches on the enum value, and returns from each case.
The compiler requires that each predefined enum value is handled,
otherwise you'll get an error like the following:
error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
However, it does not require the switch statement have a default case.
This allows one to write functions where some control paths don't have a
return value.
In Weavestack this is believed to manifest as Page Faults, because the
`AddressRemovalReasonToString()` will return an uninitialized
string_view when given a zero initialized address removal reason.
Original-Bug: 136245
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/955992
Original-Revision: a7b41ad4c654d283b0a5522c7fead5e25d18860a
GitOrigin-RevId: 0023dcd77b24259a96ea2bb0296f1e4f17429be0
Change-Id: I06b7a47edd9678673cfa4390f16ee1a2c2fab1d3
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.