Fix codegen hidden bugs

This commit is contained in:
Abdelrahman Said
2025-04-16 08:06:05 +01:00
parent 0942643b4e
commit cfa8094260
9 changed files with 26 additions and 32 deletions

View File

@@ -1,23 +1,22 @@
if (!list || !node || !(node->string)) {{
if (!list || !node || !(node->item)) {{
return;
}}
if (index == 0) {{
wapp_str8_list_push_front(list, node);
wapp_{T}_list_push_front(list, node);
return;
}} else if (index == list->node_count) {{
wapp_str8_list_push_back(list, node);
wapp_{T}_list_push_back(list, node);
return;
}}
{T}Node *dst_node = wapp_str8_list_get(list, index);
{T}Node *dst_node = wapp_{T}_list_get(list, index);
if (!dst_node) {{
return;
}}
{T}List node_list = {Tlower}_node_to_list(node);
list->total_size += node_list.total_size;
list->node_count += node_list.node_count;
{T}Node *prev = dst_node->prev;