Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-05 16:11:18 +0200
committerErich Eckner <git@eckner.net>2018-09-05 16:11:18 +0200
commit4e43b947c190be295f2db0f3cb1cfa6f810c513e (patch)
treee2977d60509d172fb30b36a3384f50c91c8c026d /community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch
parent44fbcdf7c3e29f0f16bf0a6ae84e5fa0d0bb08c6 (diff)
community/grumpy: fix 32-bit overflows
Diffstat (limited to 'community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch')
-rw-r--r--community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch b/community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch
new file mode 100644
index 00000000..ffe0f2ed
--- /dev/null
+++ b/community/grumpy/4f3cc3ed446170a161cf8ecb644a740ac233b005.patch
@@ -0,0 +1,30 @@
+From 4f3cc3ed446170a161cf8ecb644a740ac233b005 Mon Sep 17 00:00:00 2001
+From: Alan Justino <alan.justino@yahoo.com.br>
+Date: Wed, 7 Mar 2018 19:30:45 -0300
+Subject: [PATCH] Fix int underflow on 32bit CPUs
+
+---
+ tools/pkgc.go | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tools/pkgc.go b/tools/pkgc.go
+index e04017c7..93a6fe7d 100644
+--- a/tools/pkgc.go
++++ b/tools/pkgc.go
+@@ -75,6 +75,16 @@ func getConst(name string, v constant.Value) string {
+ } else {
+ format = "float64(%s)"
+ }
++ } else {
++ if i, exact := constant.Int64Val(v); exact {
++ if i > math.MinInt8 {
++ format = "int(%s)"
++ } else if i > math.MinInt32 {
++ format = "int32(%s)"
++ } else {
++ format = "int64(%s)"
++ }
++ }
+ }
+ case constant.Float:
+ format = "float64(%s)"