Functions #1

Closed
opened 2020-09-11 02:13:59 +00:00 by TheCurle · 0 comments
Owner

The current way of parsing functions is no good.
Currently, the left branch of the tree is passed down the chain, into the call routines and thus into the asm.

For functions that call other functions, like "Print(OtherFunction())", this will cause the first function to be called twice, ending up something like this in ASM:

mov $0, %rcx  
call Print  
mov $rax, %rcx  
call Print

The first call should be to OtherFunction, its return passed to Print. But it is not.

The fix for this would be a rewrite of a large section of the AST parsing system.

The current way of parsing functions is no good. Currently, the left branch of the tree is passed down the chain, into the call routines and thus into the asm. For functions that call other functions, like "Print(OtherFunction())", this will cause the first function to be called twice, ending up something like this in ASM: ``` mov $0, %rcx call Print mov $rax, %rcx call Print ``` The first call should be to OtherFunction, its return passed to Print. But it is not. The fix for this would be a rewrite of a large section of the AST parsing system.
TheCurle self-assigned this 2020-09-11 02:13:59 +00:00
TheCurle added the
help wanted
bug
labels 2020-09-11 02:25:45 +00:00
Sign in to join this conversation.
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: TheCurle/Erythro#1
No description provided.