Add missing Allocator_Error and @(require_results) to many procedures

This commit is contained in:
gingerBill
2023-05-22 11:34:38 +01:00
parent 7298054974
commit 600c97cc0f
6 changed files with 153 additions and 57 deletions
+5 -1
View File
@@ -82,7 +82,11 @@ clone_node :: proc(node: ^Node) -> ^Node {
panic("Cannot clone this node type")
}
res := cast(^Node)mem.alloc(size, align)
res := cast(^Node)(mem.alloc(size, align) or_else nil)
if res == nil {
// allocation failure
return nil
}
src: rawptr = node
if node.derived != nil {
src = (^rawptr)(&node.derived)^