Skip to content
  • Ben Gamari's avatar
    35bbc251
    cmm: Disallow shifts larger than shiftee · 35bbc251
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously primops.txt.pp stipulated that the word-size shift primops
    were only defined for shift offsets in [0, word_size). However, there
    was no further guidance for the definition of Cmm's sub-word size shift
    MachOps.
    
    Here we fix this by explicitly disallowing (checked in many cases by
    CmmLint) shift operations where the shift offset is larger than the
    shiftee. This is consistent with LLVM's shift operations, avoiding the
    miscompilation noted in #20637.
    35bbc251
    cmm: Disallow shifts larger than shiftee
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously primops.txt.pp stipulated that the word-size shift primops
    were only defined for shift offsets in [0, word_size). However, there
    was no further guidance for the definition of Cmm's sub-word size shift
    MachOps.
    
    Here we fix this by explicitly disallowing (checked in many cases by
    CmmLint) shift operations where the shift offset is larger than the
    shiftee. This is consistent with LLVM's shift operations, avoiding the
    miscompilation noted in #20637.
Loading