-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Incorrect code is generated for passing structs and arrays on the stack to functions and for returning them. In the case of passing, the caller just passes the first byte of the array or struct. The callee code is actually generated correctly and would be able to receive the object if it were passed correctly. In the case of returning, the first element of the object is stored in eax and no copying is done.
If the compiler was never meant to have these features, it should at least throw an error rather than passing/returning the first byte of the object.
EDIT: Seems like arrays of structs aren't indexed correctly (index isn't aligned to the size of the struct) and reading arrays of structs won't copy structs onto the stack either.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working