orccpu-x86: Fix undefined behaviour compilation issue
authorEdward Hervey <edward@centricular.com>
Sun, 19 Nov 2017 17:21:34 +0000 (18:21 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Sun, 19 Nov 2017 17:21:34 +0000 (18:21 +0100)
runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

orc/orccpu-x86.c

index f5620b0..03dbcb0 100644 (file)
@@ -520,10 +520,10 @@ orc_sse_detect_cpuid_amd (orc_uint32 level)
     if (edx & (1<<22)) {
       orc_x86_mmx_flags |= ORC_TARGET_MMX_MMXEXT;
     }
-    if (edx & (1<<31)) {
+    if (edx & (1U<<31)) {
       orc_x86_mmx_flags |= ORC_TARGET_MMX_3DNOW;
     }
-    if (edx & (1<<30)) {
+    if (edx & (1U<<30)) {
       orc_x86_mmx_flags |= ORC_TARGET_MMX_3DNOWEXT;
     }
   }