Skip to content

Odd boolean mask. Should it be << instead of <? #62665

@valeriyvan

Description

@valeriyvan

https://github.com/apple/swift/blob/d106dc135f562790c9de55efc84dc947bb233e65/stdlib/toolchain/CompatibilityDynamicReplacements/DynamicReplaceable.cpp#L55

  auto origKey = compat50Key.get();
  if ((origKey & 0x1) != 0) {
    auto mask = ((uintptr_t)-1) < 1;   // <<<<<<< WHAT???
    auto resetKey = origKey & mask; // then bitwise AND with integer and boolean???
    compat50Key.set(resetKey);
    return nullptr;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrellaswift 6.2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions