Closed ghost closed 3 years ago
Thanks for the report. I think it's just that I don't remember my own conventions. It's trying to iterate through all open subroutine contexts and free them, but to do that it needs to specify the list head to know when to terminate (as opposed to any arbitrary list element where it will return the list head as a valid element.)
diff --git a/builtins/ys.c b/builtins/ys.c
index 4552ad3..68c0669 100644
--- a/builtins/ys.c
+++ b/builtins/ys.c
@@ -1195,7 +1195,7 @@ YsFreeScript(
NextEntry = YoriLibGetNextListEntry(&Script->CallStackLinks, NULL);
while(NextEntry != NULL) {
StackLocation = CONTAINING_RECORD(NextEntry, YS_CALL_STACK, StackLinks);
- NextEntry = YoriLibGetNextListEntry(&StackLocation->StackLinks, NextEntry);
+ NextEntry = YoriLibGetNextListEntry(&Script->CallStackLinks, NextEntry);
YsFreeCallStack(StackLocation);
CallStackFound = TRUE;
This should be fixed in 1.50, released today. Please let me know if there are further related issues.
This code:
Makes Yori crash with exit code
3221226356
(A heap has been corrupted.
) In CMD this does the same asexit /b 0
and Yori'sreturn 0
Probably something with this code: https://github.com/malxau/yori/blob/41640e18b9ee991666ef0ac68aaa902a15c41404/builtins/ys.c#L314-L326