Array<octet> doesn't come out as expected in rust xpidl bindings
Categories
(Core :: XPCOM, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: keeler, Assigned: nika)
References
Details
Attachments
(2 files)
6.40 KB,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
If I declare something in an idl like:
void passArrayOfOctets(in Array<octet> arr);
and then I want to implement this in rust, the function I have to implement is:
unsafe fn PassArrayOfOctets(&self, arr: *const ThinVec<*mut u8>) -> nsresult {
I would expect this to be:
unsafe fn PassArrayOfOctets(&self, arr: *const ThinVec<u8>) -> nsresult {
If I actually attempt to use arr
as its declared type, gecko crashes. If I cast it to essentially be the type I'm expecting, it seems to work. I've attached a gtest I mocked up that demonstrates this.
![]() |
Reporter | |
Comment 1•6 years ago
|
||
Nika, is this how this is supposed to work? Or is there an underlying issue I'm not aware of here?
Assignee | ||
Comment 2•6 years ago
|
||
Yup, this is a bug in the codegen, my bad! The types we're generating on the Rust side are wrong. I'll put up a patch to fix this inconsistency.
Assignee | ||
Comment 3•6 years ago
|
||
Comment 5•6 years ago
|
||
bugherder |
Description
•