Bug 1313028 - GCC 6 null pointer check removal causes segfaulting in ActionResultHolder::GetValueAndDelete(). r=chmanchester.

This commit is contained in:
Julian Seward 2016-11-01 17:23:46 +01:00
parent 9189e00cd2
commit 1484a2b876

View File

@ -1354,6 +1354,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 {}
@ -1365,7 +1367,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.
@ -1374,7 +1376,7 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
const Action<F>& action,
const typename Function<F>::ArgumentTuple& args) {
action.Perform(args);
return NULL;
return new ActionResultHolder();
}
};