summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2019-03-05 13:25:21 -0800
committerStanislav Malyshev <stas@php.net>2019-03-06 00:50:09 -0800
commitdb777e9199a94f95416ea16baf82a7d10a0bbe51 (patch)
treedddcdc2fc9fa6bc55c68cbfa15e921651c16d216 /ext
parentf651397b1f874a09a7d3885a7463cdf8ea6eafa7 (diff)
downloadphp-git-db777e9199a94f95416ea16baf82a7d10a0bbe51.tar.gz
Fix shifting signed values too far
Signed shift of 31 for int and 63 for long is flagged as undefined behavior by UBSan (-fsanitize=undefined) and seems to be indeed so according to the standard. The patch converts such cases to use unsigned.
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/Optimizer/zend_cfg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h
index 19a30ad40b..7d6ef25eee 100644
--- a/ext/opcache/Optimizer/zend_cfg.h
+++ b/ext/opcache/Optimizer/zend_cfg.h
@@ -35,7 +35,7 @@
#define ZEND_BB_LOOP_HEADER (1<<16)
#define ZEND_BB_IRREDUCIBLE_LOOP (1<<17)
-#define ZEND_BB_REACHABLE (1<<31)
+#define ZEND_BB_REACHABLE (1U<<31)
#define ZEND_BB_PROTECTED (ZEND_BB_ENTRY|ZEND_BB_RECV_ENTRY|ZEND_BB_TRY|ZEND_BB_CATCH|ZEND_BB_FINALLY|ZEND_BB_FINALLY_END|ZEND_BB_UNREACHABLE_FREE)
@@ -92,7 +92,7 @@ typedef struct _zend_cfg {
} zend_cfg;
/* Build Flags */
-#define ZEND_RT_CONSTANTS (1<<31)
+#define ZEND_RT_CONSTANTS (1U<<31)
#define ZEND_CFG_STACKLESS (1<<30)
#define ZEND_SSA_DEBUG_LIVENESS (1<<29)
#define ZEND_SSA_DEBUG_PHI_PLACEMENT (1<<28)