fix match causing stack garbage when array lengths mismatch

This commit is contained in:
Daniella / Tove 2024-11-15 15:31:31 +01:00
parent fd0aed81fd
commit 92858f6baf
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -655,7 +655,7 @@ func check-match { bool | with input output ;
def i, n def i, n
0 =i 0 =i
output:len =n output:len =n
input:len n eq not if { 0 2 stop } input:len n eq not if { 0 3 stop }
1 while { i n lt } { 1 while { i n lt } {
input:get<i> output:get<i> check-match and input:get<i> output:get<i> check-match and
i ++ =i i ++ =i
@ -674,7 +674,7 @@ func match-unchecked { | with input output ;
def i, n def i, n
0 =i 0 =i
output:len =n output:len =n
input:len n eq not if { 2 stop } input:len n eq not if { 3 stop }
while { i n lt } { while { i n lt } {
input:get<i> output:get<i> match-unchecked input:get<i> output:get<i> match-unchecked
i ++ =i i ++ =i
@ -694,7 +694,7 @@ func match { bool | with input output ;
def i, n def i, n
0 =i 0 =i
output:len =n output:len =n
input:len n eq not if { 0 2 stop } input:len n eq not if { 0 3 stop }
1 while { i n lt } { 1 while { i n lt } {
input:get<i> output:get<i> check-match and input:get<i> output:get<i> check-match and
i ++ =i i ++ =i