From 9a82a8675782f137c8739bc950ac86dfe6a8dfd1 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 23 Jul 2015 09:30:15 +0100 Subject: 35793: avoid undefined behaviour shifting signed number --- Src/zsh.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Src/zsh.h') 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. -- cgit 1.4.1