Skip to content
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

fix: addDebugInfo before convertExpression #2835

Closed

Conversation

XMadrid
Copy link
Contributor

@XMadrid XMadrid commented Apr 3, 2024

Fixes #2833 .

add debugLocation before convertExpression.
For code snippet:

function add(a: i32, b: i32): i32 {
  return a + b;
}

add(1, 2);

Before this PR, we emit:

addDebugLocation(drop, line = 5, column = 2);       // In there, we should emit `call` instruction
addDebugLocation(drop, line = 5, column = 2); 

With this PR, we emit:

addDebugLocation(call, line = 5, column = 2);      
addDebugLocation(drop, line = 5, column = 2); 
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

Copy link
Member

@HerrCai0907 HerrCai0907 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find any reason to move this debug location from outside expr to inside expr.

@XMadrid
Copy link
Contributor Author

XMadrid commented Apr 7, 2024

I think we can emit debug location for both outside expr and inside expr.

@XMadrid XMadrid force-pushed the emit-correct-debug-locations branch from 586e7a2 to 42f559f Compare April 8, 2024 06:43
@XMadrid XMadrid requested a review from HerrCai0907 April 8, 2024 07:54
Copy link

github-actions bot commented Jun 7, 2024

This PR has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!

@github-actions github-actions bot added the stale label Jun 7, 2024
Copy link

This PR has been automatically closed due to lack of recent activity, but feel free to reopen it as long as you merge in the main branch afterwards.

@github-actions github-actions bot closed this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit incorrect debugLocation while convertExpression()
2 participants