From 16e265c7d25ed190484a70fc51681d6dd9bdd2cc Mon Sep 17 00:00:00 2001 From: Ben Doerr Date: Wed, 23 Jun 2021 09:55:14 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MaxUint32=20assignment=20t?= =?UTF-8?q?o=20platform=20int?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue where math.MaxUint32 is assigned to a platform dependent int type. This works on 64-bit platforms without issue due to there being plenty of space. On 32-bit platforms this is wrong and will not compile as math.MaxUint32 > math.MaxInt32. --- expressions/y.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expressions/y.go b/expressions/y.go index 35d6647..abf2201 100644 --- a/expressions/y.go +++ b/expressions/y.go @@ -664,7 +664,7 @@ yydefault: yyDollar = yyS[yypt-0 : yypt+1] //line expressions.y:105 { - yyVAL.loopmods = loopModifiers{Cols: math.MaxUint32} + yyVAL.loopmods = loopModifiers{Cols: math.MaxInt32} } case 21: yyDollar = yyS[yypt-2 : yypt+1]