aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/analyzer.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 10:11:56 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 10:11:56 +0330
commite1e0a265e931637f452ac05bb7d912e07bcee574 (patch)
tree60289bb1fc3d812dfc576f01e0f8a83091a495c1 /src/compiler/analyzer.zc
parentanalyzer: check borrow returns of forward-called functions at the unit's end;... (diff)
lsp: borrow errors ranged on the use, with related information for where the owner ended and was declared; vscode client passes relatedInformation through
Diffstat (limited to 'src/compiler/analyzer.zc')
-rw-r--r--src/compiler/analyzer.zc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/analyzer.zc b/src/compiler/analyzer.zc
index 103f732..ff6a6c1 100644
--- a/src/compiler/analyzer.zc
+++ b/src/compiler/analyzer.zc
@@ -1002,9 +1002,10 @@ int lend_drop(int dep, int from) {
// or untracked memory, 7 freed by reassigning it, 8 pushed into end_whom.
int end_why; char* end_whom;
int end_owner(int i) {
- int j = lbase; word info = talloc(5);
+ int j = lbase; word info = talloc(6);
lend_check(i);
info[0] = lname[i]; info[1] = lpos[i]; info[2] = tpack(); info[3] = end_why; info[4] = end_whom;
+ info[5] = lreadpos[i]; if (!info[5]) info[5] = info[2]; // the owner's own token where it ended, for the editor
end_why = 0; end_whom = 0;
local_ended[i] = info[2]; local_end_info[i] = info; lstate[i] = S_DEAD;
while (j < nloc) {