Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix -Wtype-limits warnings by removing redundant assertions #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 15, 2023

  1. Fix -Wtype-limits warnings by removing redundant assertions

    This was uncovered in the context of WebKit. These assertions
    are always true as the bitfield variables in question are
    too small to hold the values that the assertions are comparing
    against:
    
    - ZydisSetAttributes: The arrays are defined to be larger than
    the bitfield holding cpu_state, fpu_state, and xmm_state,
    so the comparison is always true.
    
    - ZydisSetEffectiveOperandWidth: operand_size_map is a 3-bit bitfield,
    and the arrays have a size 8, thus the comparison is always true.
    
    - ZydisGetOperandDefinitions: operand_reference is a 15-bit bitfield,
    it can't hold 0xFFFF (which needs 16 bits), so the comparison is always
    true.
    
    See also https://bugs.webkit.org/show_bug.cgi?id=252309
    csaavedra committed Mar 15, 2023
    Configuration menu
    Copy the full SHA
    8d6745c View commit details
    Browse the repository at this point in the history