Closed
Bug 858619
Opened 12 years ago
Closed 12 years ago
GC: Address rooting hazards in ctypes
Categories
(Core :: js-ctypes, defect)
Core
js-ctypes
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(1 file)
(deleted),
patch
|
terrence
:
review+
|
Details | Diff | Splinter Review |
Address rooting hazards in ctypes as reported by static analysis.
I noticed this is not used by the browser so I deliberately didn't change any interfaces so as not to break external clients.
Attachment #733902 -
Flags: review?(terrence)
Comment 1•12 years ago
|
||
Comment on attachment 733902 [details] [diff] [review]
Proposed changes
Review of attachment 733902 [details] [diff] [review]:
-----------------------------------------------------------------
This is fine for now. Keep in mind that ctypes is meant to be used from JS: we don't actually expose the C interface to anything outside the tree -- at least not any greater degree than other code we write. The browser code that exposes ctypes as a Component in chrome is in toolkit/components/ctypes/: it's extremely short, so it would probably be worth a read to see which of the CTypes.cpp interfaces are purely internal.
::: js/src/ctypes/CTypes.cpp
@@ +2574,5 @@
> // Convert jsval 'val' to a C binary representation of CType 'targetType',
> // storing the result in 'buffer'. This function is more forceful than
> // ImplicitConvert.
> JSBool
> +ExplicitConvert(JSContext* cx, jsval val_, HandleObject targetType, void* buffer)
This interface is already using a handle. Maybe see if a HandleValue just works here?
Attachment #733902 -
Flags: review?(terrence) → review+
Assignee | ||
Comment 2•12 years ago
|
||
(In reply to Terrence Cole [:terrence] from comment #1)
Ah, I didn't see where this was used from the browser.
I updated ExplicitConvert().
Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Assignee: nobody → jcoppeard
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in
before you can comment on or make changes to this bug.
Description
•