-
Notifications
You must be signed in to change notification settings - Fork 1
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Register override #8
Comments
Is open for reopen |
Wasn't fixed i knew it |
Debugging is a bit hard because gimli-rs/object#721 |
Fixed. After some long debugging sessions i found out why. It's because the variables which are in the registers for the function arguments get overriten and then read for the new argument. Example assembly line:
Yeah, so i need to fix that. Maybe by using the stack? |
Why did github close the issue?? |
So i found out the generated assembly code is now correct but the instruction encoding has some errors again! |
Describe the bug
Running a simple example from simplelang:
Outputs:
What it shouldn't. Here's the expected output:
The
1827627024
is the adress of the formatting string (%d = %d
) which means that the register of the variablex
gets overrideden.IR
In line:
%3 = i64 %2
the compile thinks that%2
is dropped which means it frees the resources. But sussly the resources from the last free aren't assignet back so the register for the variable gets overriden by the next line:%4 = ptr .const1
Generated assembly
The text was updated successfully, but these errors were encountered: