Author:ptrace Comitter:ptrace Date:2026-03-19 04:45:18 UTC

In commit() it took views into arrays and string references, pointing to an invalid memory area later on.

diff --git a/htmltemplate/lib.jai b/htmltemplate/lib.jai index 3cd0006..8c1dfc0 100644 --- a/htmltemplate/lib.jai +++ b/htmltemplate/lib.jai @@ -107,8 +107,8 @@ generate :: ( commit :: (queue_action: *[..]Action, id: string, value: [][]string) {     action: Action = {         id = id,         nested = value,         id = copy_string(id),         nested = array_copy(value),         kind = .LOOP     };     array_add(queue_action, action); @@ -116,8 +116,8 @@ commit :: (queue_action: *[..]Action, id: string, value: [][]string) { commit :: (queue_action: *[..]Action, id: string, value: []string) {     action: Action = {         id = id,         flat = value,         id = copy_string(id),         flat = array_copy(value),         kind = .REPLACE     };     array_add(queue_action, action); @@ -126,11 +126,11 @@ commit :: (queue_action: *[..]Action, id: string, value: []string) { /** TODO(adam, 5): If not inlined it will result in bogus data in `queue_action`.                    This is quite janky. Investigate. */ commit :: inline (queue_action: *[..]Action, id: string, value: string) { commit :: (queue_action: *[..]Action, id: string, value: string) {     commit(queue_action, id, .[value]); } commit :: inline (queue_action: *[..]Action, id: string, value: ..string) { commit :: (queue_action: *[..]Action, id: string, value: ..string) {     commit(queue_action, id, value); }