Currently JSProperty is defined as a struct with the single id member field but the code never dereference JSProperty except in one single place in jsarray.cpp that I added in bug 486106 and that can be trivially avoided. Thus I suggest to remove JSProperty struct definition and just keep it as an opaque pointer typedef. This would also allow to change lookupProperty to return JSProperty instead of using pass-by-the pointer out param. To distinguish a failure from not-found condition the code can simply define (JSProperty *) 1 as a value indicating an error. But this can go to another bug.
Created attachment 370393 [details] [diff] [review] v1 The patch removes the definition of JSProperty struct and moves its typedef from jspubtd.h to jsprvtd.h .
Attachment #370393 - Flags: review?(brendan)
Attachment #370393 - Flags: review?(brendan) → review?(mrbkap)
landed to TM - http://hg.mozilla.org/tracemonkey/rev/bd50ffde19c8 I nominate this for 1.9.1 to make sure on that branch as well that the code never dereference JSProperty. That would immediately leads to bugs due to a usage like (JSProperty *) 1 in liveconnect.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.