History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-400
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Doug H
Reporter: Arron Washington
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Boo is emitting bad IL when dealing with PInvokes.

Created: 21/Jul/05 08:57 PM   Updated: 30/Jan/06 02:43 PM
Component/s: Emitter
Affects Version/s: 0.5.6
Fix Version/s: 0.7.6

Time Tracking:
Not Specified

File Attachments: 1. Text File pinvoke-fix.patch (6 kb)
2. File pinvoke.boo (0.7 kb)
3. File pinvoke2.boo (2 kb)



 Description  « Hide
The attached file, when built as a library, produces an IL byte-code, thereby rendering it unable to be linked against by any .NET applications. Or libraries.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Doug H - 22/Jul/05 03:30 PM
I changed some things like your callable definition and it worked for me in booi.

But if I compile using booc and then run the exe, I get an error that the types cannot be loaded because EnumWindows has no RVA.


Arron Washington - 22/Jul/05 03:34 PM
Oh, it works if you run it, but if you make an assembly or .exe out of it, you can't link against it. I'm not even sure if you can run an .exe, I hadn't tried.

What I know is that the P/Invoke signature is valid in C# and I'm not sure why it fails in Boo. ;(


Arron Washington - 16/Aug/05 07:53 PM
I've been playing with the code that caused this issue a bit, and it seems to only occur if you define more than one P/Invoke per class or per assembly (can't tell which )

Doug H - 27/Jan/06 08:31 PM
Patch fixes this issue as well as BOO-647 (makes p/invoke methods static). Also it will throw an error if you have a p/invoke method with a non-empty body.

Rodrigo B. de Oliveira - 30/Jan/06 08:39 AM
Looks good.

Rodrigo B. de Oliveira - 30/Jan/06 02:43 PM
Patch applied. Thanks!