[Gambas-bugtracker] Bug #2640: Jit fails to compile

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sun Oct 16 19:20:01 CEST 2022


http://gambaswiki.org/bugtracker/edit?object=BUG.2640&from=L21haW4-

Comment #3 by Brian G:

At some point in the past Gambas would not allow the direct conversion to a struct of a pointer I guess so
memcpy was used as a dummy call 0 length, re-defined a number of times each redefinition used to convert a pointer to a specific structure type.

as follows:

   Extern SetBlockInfo(dest As Pointer, src As Pointer, Len As Integer) As MemBlockHeader In "libc:6" Exec "memcpy"

this converts a pointer to an actual structure pointer here are some other examples:

Extern AllocInteger(dest As Pointer, src As Pointer, Len As Integer) As DInteger In "libc:6" Exec "memcpy"
Extern AllocBoolean(dest As Pointer, src As Pointer, Len As Integer) As DBoolean In "libc:6" Exec "memcpy"
Extern AllocByte(dest As Pointer, src As Pointer, Len As Integer) As DByte In "libc:6" Exec "memcpy"
Extern AllocShort(dest As Pointer, src As Pointer, Len As Integer) As DShort In "libc:6" Exec "memcpy"
Extern AllocLong(dest As Pointer, src As Pointer, Len As Integer) As DLong In "libc:6" Exec "memcpy"
Extern AllocSingle(dest As Pointer, src As Pointer, Len As Integer) As DSingle In "libc:6" Exec "memcpy"
Extern AllocFloat(dest As Pointer, src As Pointer, Len As Integer) As DFloat In "libc:6" Exec "memcpy"
Extern AllocDate(dest As Pointer, src As Pointer, Len As Integer) As DDate In "libc:6" Exec "memcpy"
Extern AllocStrObj(dest As Pointer, src As Pointer, Len As Integer) As DStrObj In "libc:6" Exec "memcpy"
Extern AllocPointer(dest As Pointer, src As Pointer, Len As Integer) As DPointer In "libc:6" Exec "memcpy"

Looks like it is not need at all any more! as I can directly convert 
dim a as pointer = 100
to:
dim MyStruct as thestruct 

just doing: 

mystruct = a

Or maybe i just thought that anyway.....

but as to the crash it looks like maybe the return value in jit is not handled correctly from the call...

And thanks for fixing the other issues.




More information about the Bugtracker mailing list