summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-07-23 09:30:15 +0100
committerPeter Stephenson <pws@zsh.org>2015-07-23 09:31:12 +0100
commit9a82a8675782f137c8739bc950ac86dfe6a8dfd1 (patch)
treef5dc107d9be8a0716df4888d9c7b11fb6984c879 /Src/zsh.h
parent346fcf9b96c7b52df9a9d9a4a453aa1bb35808fb (diff)
downloadzsh-9a82a8675782f137c8739bc950ac86dfe6a8dfd1.tar.gz
zsh-9a82a8675782f137c8739bc950ac86dfe6a8dfd1.tar.xz
zsh-9a82a8675782f137c8739bc950ac86dfe6a8dfd1.zip
35793: avoid undefined behaviour shifting signed number
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index 69fef33f5..a99c90065 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1752,9 +1752,10 @@ struct tieddata {
 				  * necessarily want to match multiple
 				  * elements
 				  */
-#define SCANPM_ISVAR_AT   ((-1)<<15)	/* "$foo[@]"-style substitution
-					 * Only sign bit is significant
-					 */
+/* "$foo[@]"-style substitution
+ * Only sign bit is significant
+ */
+#define SCANPM_ISVAR_AT   ((int)(((unsigned int)-1)<<15))
 
 /*
  * Flags for doing matches inside parameter substitutions, i.e.