Fix segfault

This commit is contained in:
bʰedoh₂ swé 2024-06-10 00:41:11 +05:00
parent 95862b56d2
commit 3a3014f9a3

View File

@ -31,7 +31,9 @@ bool process_find(tSyntaxElement* tree, tProcessingData** p_pdata) {
tProcessingData* pd = *p_pdata;
bool deffound = false;
if (se_istraversable(tree))
if (tree->content.syntax->type == TOKEN && tree->content.syntax->next != NULL) {
if (tree->content.syntax->type == TOKEN &&
tree->content.syntax->next != NULL &&
tree->content.syntax->next->next != NULL) {
tSyntaxElement* token = tree->content.syntax;
if (strcmp(token->content.string,"def") == 0) {
char* replacethis = token->next->content.string;