From 2820521bfb580b3ed71fa6f5c9ff74ed357105df Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Mon, 26 Feb 2018 08:49:19 -0800 Subject: [PATCH] Bug 1441205 - XPTMethodDescriptor::result is unused. r=njn This sounds weird, but either: 1) A method is notxpcom, so it can't be called from script and the XPT information is unused. 2) A method is not notxpcom, in which case the result type is nsresult. MozReview-Commit-ID: a7SRJn8PlP --HG-- extra : rebase_source : 457051a47dd3f1f2f49b5f11ef3e5138f9d814e1 --- xpcom/reflect/xptinfo/xptinfo.h | 2 -- xpcom/typelib/xpt/xpt_struct.cpp | 7 ++++++- xpcom/typelib/xpt/xpt_struct.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xpcom/reflect/xptinfo/xptinfo.h b/xpcom/reflect/xptinfo/xptinfo.h index 148867d619d4..4f3661564385 100644 --- a/xpcom/reflect/xptinfo/xptinfo.h +++ b/xpcom/reflect/xptinfo/xptinfo.h @@ -198,8 +198,6 @@ public: NS_PRECONDITION(idx < GetParamCount(),"bad arg"); return params[idx]; } - const nsXPTParamInfo GetResult() const - {return result;} private: nsXPTMethodInfo(); // no implementation // NO DATA - this a flyweight wrapper diff --git a/xpcom/typelib/xpt/xpt_struct.cpp b/xpcom/typelib/xpt/xpt_struct.cpp index 4c847ae80c7c..00c33b063a3b 100644 --- a/xpcom/typelib/xpt/xpt_struct.cpp +++ b/xpcom/typelib/xpt/xpt_struct.cpp @@ -316,7 +316,12 @@ DoMethodDescriptor(XPTArena *arena, NotNull cursor, return false; } - if (!DoParamDescriptor(arena, cursor, &md->result, id)) + // |result| appears in the on-disk format but it isn't used, + // because a method is either notxpcom, in which case it can't be + // called from script so the XPT information is irrelevant, or the + // result type is nsresult. + XPTParamDescriptor result; + if (!DoParamDescriptor(arena, cursor, &result, id)) return false; return true; diff --git a/xpcom/typelib/xpt/xpt_struct.h b/xpcom/typelib/xpt/xpt_struct.h index bccace6b164e..d9d73cf52909 100644 --- a/xpcom/typelib/xpt/xpt_struct.h +++ b/xpcom/typelib/xpt/xpt_struct.h @@ -286,7 +286,7 @@ struct XPTParamDescriptor { struct XPTMethodDescriptor { char *name; XPTParamDescriptor *params; - XPTParamDescriptor result; + //XPTParamDescriptor result; // Present on disk, omitted here. uint8_t flags; uint8_t num_args; };