summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/zsh.h7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 69a78b16d..5036ea9ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-23  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 35793: Src/zsh.h: avoid undefined behaviour shifting signed
+	number.
+
 2015-07-23  Oliver Kiddle <opk@zsh.org>
 
 	* 35753: Completion/Zsh/Type/_ps1234: allow for numbers after
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.