mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Fix segfault in gmock when running tests (#514)
Taken from https://github.com/google/googletest/issues/705#issuecomment-235067917
This commit is contained in:

committed by
Jesse Beder

parent
11607eb5bf
commit
efbfa1c7c7
@@ -1370,6 +1370,8 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
|
||||
template <>
|
||||
class ActionResultHolder<void> : public UntypedActionResultHolderBase {
|
||||
public:
|
||||
explicit ActionResultHolder() {}
|
||||
|
||||
void GetValueAndDelete() const { delete this; }
|
||||
|
||||
virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
|
||||
@@ -1381,7 +1383,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
|
||||
const typename Function<F>::ArgumentTuple& args,
|
||||
const string& call_description) {
|
||||
func_mocker->PerformDefaultAction(args, call_description);
|
||||
return NULL;
|
||||
return new ActionResultHolder();
|
||||
}
|
||||
|
||||
// Performs the given action and returns NULL.
|
||||
@@ -1390,7 +1392,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
|
||||
const Action<F>& action,
|
||||
const typename Function<F>::ArgumentTuple& args) {
|
||||
action.Perform(args);
|
||||
return NULL;
|
||||
return new ActionResultHolder();
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user