[pcre-dev] [Bug 2355] New: 1 << 31 is undefined behaviour

Page principale
Supprimer ce message
Auteur: admin
Date:  
À: pcre-dev
Sujet: [pcre-dev] [Bug 2355] New: 1 << 31 is undefined behaviour
https://bugs.exim.org/show_bug.cgi?id=2355

            Bug ID: 2355
           Summary: 1 << 31 is undefined behaviour
           Product: PCRE
           Version: 10.32 (PCRE2)
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: seth.arnold@???
                CC: pcre-dev@???


Hello, cppcheck has reported some issues like:
[src/sljit/sljitNativeARM_64.c:473]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:475]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:479]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:563]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:713]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:721]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:731]: (error) Shifting signed 32-bit value by 31
bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:1083]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:1363]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:1385]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:1665]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour
[src/sljit/sljitNativeARM_64.c:1790]: (error) Shifting signed 32-bit value by
31 bits is undefined behaviour

Replacing `1 << 31` with `1U << 31` ought to do the trick.

Thanks

--
You are receiving this mail because:
You are on the CC list for the bug.