Closed Bug 560587 Opened 14 years ago Closed 12 years ago

GeneratePropertyOp doesn't explain to the compiler that it's aware of how JS_SetReservedSlot works for JSFunction

Categories

(Core :: XPConnect, defect)

defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity)

Attachments

(1 file, 1 obsolete file)

163 GeneratePropertyOp(JSContext *cx, JSObject *obj, jsval idval, uintN argc,

168     JSFunction *fun =
169         JS_NewFunction(cx, reinterpret_cast<JSNative>(PropertyOpForwarder),
170                        argc, JSFUN_FAST_NATIVE, obj, name);
174     JSObject *funobj = JS_GetFunctionObject(fun);

189     JS_SetReservedSlot(cx, funobj, 0, OBJECT_TO_JSVAL(ptrobj));
190     JS_SetReservedSlot(cx, funobj, 1, idval);
Attached patch proposal (obsolete) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #440273 - Flags: review?(mrbkap)
Attached patch proposalSplinter Review
Attachment #440273 - Attachment is obsolete: true
Attachment #440485 - Flags: review?(mrbkap)
Attachment #440273 - Flags: review?(mrbkap)
timeless, can you please explain why these are needed?
doing this enables coverity (and similar tools) to recognize cases where a function isn't safely used. currently coverity warns that you aren't checking a function whose return value is usually checked.
This ended up getting fixed by bug 697537.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Attachment #440485 - Flags: review?(mrbkap)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: