Skip to content

Commit 635d7bb

Browse files
committed
Fix shift out of bounds on 32-bit non-fast-path platforms
mysqlnd_portability.h:221:95: error: right shift count >= width of type [-Werror=shift-count-overflow]
1 parent e865c64 commit 635d7bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/mysqlnd/mysqlnd_portability.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ typedef union {
217217
*(((char *)(T))+1) = (char)(((A) >> 8));\
218218
*(((char *)(T))+2) = (char)(((A) >> 16));\
219219
*(((char *)(T))+3) = (char)(((A) >> 24)); \
220-
*(((char *)(T))+4) = (char)(((A) >> 32)); } while (0)
221-
#define int8store(T,A) { uint32_t def_temp= (uint32_t) (A), def_temp2= (uint32_t) ((A) >> 32); \
220+
*(((char *)(T))+4) = sizeof(A) == 4 ? 0 : (char)(((A) >> 32)); } while (0)
221+
#define int8store(T,A) { uint32_t def_temp= (uint32_t) (A), def_temp2= sizeof(A) == 4 ? 0 : (uint32_t) ((A) >> 32); \
222222
int4store((T),def_temp); \
223223
int4store((T+4),def_temp2); \
224224
}

0 commit comments

Comments
 (0)