Closed Bug 416229 Opened 17 years ago Closed 17 years ago

Add support for nsINativeTypes.STRING

Categories

(Core :: js-ctypes, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: nossralf, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b4pre) Gecko/2008020604 Minefield/3.0b4pre Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008013122 Minefield/3.0b3pre As it stands, nsINativeTypes has a constant called STRING defined (corresponds to char* buffers) but no implementation exists for it. When declaring a library function where the return type or a parameter is nsINativeTypes.STRING no error is returned, but when the declared function is subsequently called from JavaScript, Firefox crashes due to ffi_prep_cif() receiving incomplete parameter information. Reproducible: Always Steps to Reproduce: 1.Open a shared library using js-ctypes. 2.Declare a function where a parameter or the return type is of type nsINativeTypes.STRING. 3.Attempt to call the declared function from JavaScript. Actual Results: Firefox crashes due to a segmentation fault. Expected Results: The function returns and Firefox doesn't segfault.
Attached patch tentative fixSplinter Review
This is a patch that simply follows the logic for WSTRING and adds support for STRING in nsNativeMethod::Execute.
landed, thanks
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Other Applications → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: