[Vm-dev] a problem with alien, primitive fail (primFFICallResult:withArguments:)

Esteban Lorenzano estebanlm at gmail.com
Tue Dec 28 00:54:57 UTC 2010


Hi, 
I'm trying to get the Alien ObjectiveC bridge to work, and I'm having a problem (right now no cog, just cocoa vm 5.7 with "regular" alien, NewspeakI32ABIPlugin), and I'm having a problem on sending a message with this form: 

someAlien
	primFFICallResult: resultAlien
	withArguments: {anAlien. aLargePositiveInteger}

so... it is answering primitiveFail (code 3), because the third argument is bad taken when converting... the primitive does this path: 

callIA32IntegralReturn,
...
long v = interpreterProxy->signed32BitValueOf(arg);
...
	value = (((byteAt((oop + (BASE_HEADER_SIZE)) + 0)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 1)) << 8)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 2)) << 16)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 3)) << 24);

value here is negative, and of course, it throws an error. 

So... anybody has a clue of whats wrong? I know the number is actually a LargePositiveInteger, so it should be ok, and pass... so any idea?

Cheers,
Esteban



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101227/705829ba/attachment.htm


More information about the Vm-dev mailing list