Disallow return of non-primitive values #376

Merged
sb10q merged 1 commits from enhance/disallow-non-primitive-return into master 2024-08-17 17:37:20 +08:00
Collaborator

Returning of non-primitive values is currently broken, as they will return a pointer to a locally alloca-ed value, which is then freed at the moment the function returns.

Disallow this until escape analysis (#54) or some other workaround is implemented.

Returning of non-primitive values is currently broken, as they will return a pointer to a locally `alloca`-ed value, which is then freed at the moment the function returns. Disallow this until escape analysis (#54) or some other workaround is implemented.
derppening added 2 commits 2024-01-29 12:57:26 +08:00
b3736c3e99 core: Disallow returning of non-primitive values
Non-primitive values are represented by an `alloca`-ed value in the
function body, and when the pointer is returned from the function, the
`alloca`-ed object is deallocated on the stack.

Related to #54.
derppening requested review from sb10q 2024-01-29 12:57:31 +08:00
sb10q merged commit fef4b2a5ce into master 2024-01-29 21:11:43 +08:00
sb10q deleted branch enhance/disallow-non-primitive-return 2024-01-29 21:11:43 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#376
No description provided.