Xinqi Bao's Git

ram: fixed int overflow on pagetok macro
authorTobias Tschinkowitz <[email protected]>
Thu, 24 May 2018 10:09:26 +0000 (12:09 +0200)
committerAaron Marcher <[email protected]>
Thu, 24 May 2018 12:51:30 +0000 (14:51 +0200)
components/ram.c

index 0ac9753..0333b3b 100644 (file)
@@ -75,7 +75,7 @@
        #include <unistd.h>
 
        #define LOG1024         10
-       #define pagetok(size, pageshift) ((size) << (pageshift - LOG1024))
+       #define pagetok(size, pageshift) (size_t)(size << (pageshift - LOG1024))
 
        inline int
        load_uvmexp(struct uvmexp *uvmexp)