AssemblyScript / assemblyscript

A TypeScript-like language for WebAssembly.
https://www.assemblyscript.org
Apache License 2.0
16.82k stars 655 forks source link

fix: addDebugInfo before convertExpression #2835

Closed XMadrid closed 3 months ago

XMadrid commented 6 months ago

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); 
XMadrid commented 6 months ago

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

github-actions[bot] commented 3 months ago

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[bot] commented 3 months ago

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.