From 92858f6baf8ee07b26a2a0577ba23fd4c0653064 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 15 Nov 2024 15:31:31 +0100 Subject: [PATCH] fix match causing stack garbage when array lengths mismatch --- spl/std.spl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spl/std.spl b/spl/std.spl index 26d0ff8..e418249 100644 --- a/spl/std.spl +++ b/spl/std.spl @@ -655,7 +655,7 @@ func check-match { bool | with input output ; def i, n 0 =i 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 } { input:get output:get check-match and i ++ =i @@ -674,7 +674,7 @@ func match-unchecked { | with input output ; def i, n 0 =i output:len =n - input:len n eq not if { 2 stop } + input:len n eq not if { 3 stop } while { i n lt } { input:get output:get match-unchecked i ++ =i @@ -694,7 +694,7 @@ func match { bool | with input output ; def i, n 0 =i 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 } { input:get output:get check-match and i ++ =i