[ptr] native nsIFoo [without trailing paren] crashes xpidl

RESOLVED FIXED

Status

()

Core
XPCOM
P3
minor
RESOLVED FIXED
19 years ago
10 years ago

People

(Reporter: Mike McCabe, Assigned: shaver)

Tracking

({crash})

Trunk
crash
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
Travis Bogard wrote:

So to help you out with the crash.  I found the problem in the IDL that was
causing the crash.  Changing the line that had the native ptr declaration...

[ptr] native nsIPresContext; should be
[ptr] native nsIPresContext(nsIPresContext);

Travis
(Reporter)

Comment 1

19 years ago
Created attachment 2340 [details]
the offending example
(Reporter)

Updated

19 years ago
Status: NEW → ASSIGNED
(Reporter)

Comment 2

19 years ago
So it turns out that libIDL parses [ptr] native nsIFoo; quite happily, but xpidl
gets null when it tries to access .user_type and crashes in fputs.

Shaver, maybe you can help me out with the history some... 'native' is special
to xpidl, correct?  Is there any sense to libIDL accepting native nsIFoo;
without an associated (nsIUserType) ?  If no, we should flag this as invalid
syntax in libIDL.  I'll patch in something for now to catch it in xpidl.

Also, do you know if andrewtv has a buzilla login?
(Reporter)

Comment 3

19 years ago
Adding andrewtv, I hope.
(Reporter)

Comment 4

19 years ago
Yay!  Got your bugzilla ID right.

Andrew, can you comment?
|native| is from OMG IDL, where it's unparameterized.  We should flag it as an
error, my bad that we don't already.
(Reporter)

Comment 6

19 years ago
Ah.  Yep, found it.  Bottom of page 3-14 in the Corba v2.3 IDL grammar.  Looks
like adding a trailing (foo) is an xpidl innovation.

I wonder if
 [ptr,id(nsIFoo)] native nsIFoo;
would have been a cleaner extension.
Assignee: mccabe → shaver
Status: ASSIGNED → NEW
Fix sent to mccabe for review.

(No, mccabe, that would have been ugly. =) )
(Reporter)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Reporter)

Comment 8

19 years ago
Fixed.  Thanks, shaver.

Comment 9

18 years ago
Adding crash keyword
Keywords: crash

Updated

10 years ago
Component: xpidl → XPCOM
QA Contact: mike+mozilla → xpcom
You need to log in before you can comment on or make changes to this bug.