----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/46821/#review146876 -----------------------------------------------------------
Fix it, then Ship it! 3rdparty/libprocess/src/subprocess.cpp (line 149) <https://reviews.apache.org/r/46821/#comment213651> `if (flags != nullptr) {` - Michael Park On Aug. 25, 2016, 5:53 p.m., Benjamin Bannier wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/46821/ > ----------------------------------------------------------- > > (Updated Aug. 25, 2016, 5:53 p.m.) > > > Review request for mesos, Alexander Rukletsov, Joris Van Remoortere, and > Michael Park. > > > Bugs: MESOS-3335 > https://issues.apache.org/jira/browse/MESOS-3335 > > > Repository: mesos > > > Description > ------- > > While `FlagsBase` internally stores just maps of names and > flags, the functions stored in a `Flag` rely on the original type of > the `Flags` containing them (e.g., we perform dynamic casts to detect > their types). > > Since `Option<T>` stores `T` as a value (i.e., it cannot contain > reference types) any interface taking an `Option<T>` cannot rely on > polymorphic behavior of `T`. To make use of polymorphism we should > instead store e.g., a pointer type to avoid slicing. > > Here we change `Flags` arguments of `subprocess` to allow preserving > the original type so `Flag` functions can work reliably; we do this by > passing a non-owning pointer to a `Flags` so we do not restrict copying. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/ssl/gtest.hpp > 83778bbfcc75f3f39b98d03a3580398e7d1062ea > 3rdparty/libprocess/include/process/subprocess_base.hpp > e0c6b2d930fbd2cfe011e6faf44843b83ab1db27 > 3rdparty/libprocess/src/subprocess.cpp > 44073146118b6c6e9e730b8c901852594080a3eb > 3rdparty/libprocess/src/tests/subprocess_tests.cpp > 3f3e21514bd5e2e388165eb64d540764097557ac > > Diff: https://reviews.apache.org/r/46821/diff/ > > > Testing > ------- > > Tested on various platforms in internal CI. > > > Thanks, > > Benjamin Bannier > >