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

scanner_free crashes with special file on windows #64

Open
sunderme opened this issue Apr 29, 2023 · 1 comment
Open

scanner_free crashes with special file on windows #64

sunderme opened this issue Apr 29, 2023 · 1 comment

Comments

@sunderme
Copy link

texstudio-org/texstudio#3083

Crashes on windows, probably because stack size is smaller.
From the looks of it, call depth is too large for recursive _synctex_free_leaf/synctex_node_free

@sunderme
Copy link
Author

fixed by avoiding recursive function calls for node siblings.

static void _synctex_free_node(synctex_node_p node) {
    if (node) {
        SYNCTEX_SCANNER_REMOVE_HANDLE_TO(node);
        SYNCTEX_WILL_FREE(node);
        synctex_node_p n=node;
        synctex_node_p nextNode=n;
        do {
            nextNode=__synctex_tree_sibling(n);
            synctex_node_free(_synctex_tree_child(n));
            _synctex_free(n);
        } while(n=nextNode);
    }
    return;
}

jlaurens added a commit that referenced this issue Mar 9, 2024
Less recursion when nodes are freed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant