Skip to content

Objective-C: bitwise_ops counts the block caret and address-of (precision 0.01); thread_sleeps misses NSThread sleepForTimeInterval #8907

Done

Description

@squid-protocol

What is wrong

Objective-C bitwise_ops counts the block caret and address-of, and thread_sleeps misses the Foundation sleep call. Found with an Objective-C oracle on AFNetworking (752 functions matched; args 1.00 / 1.00 and branch 1.00 / 1.00, so the oracle reads functions correctly):

  • bitwise_ops precision 0.01: ^ as the block literal / block-pointer caret (void (^blk)(void) = ^{ ... };) and & as address-of (int *p = &a;) are read as XOR and AND. The contract counts a bitwise operator "applied between value operands ... in operator position": a block caret is a type and a literal opener, and a unary & is an address, not an operand operation.
  • thread_sleeps misses [NSThread sleepForTimeInterval:] (and, per the oracle's reading of "a sleep, a timed wait, a timeout-driven deferral", dispatch_after and performSelector:afterDelay:; those are a judgement call, the Foundation sleep is not).

Reproduce (pinned scanner; counts read from function_data)

void blockCaret(void) { void (^blk)(void) = ^{ int x = 1; }; blk(); }   // bitwise_ops == 2, should be 0
int addrOf(int a) { int *p = &a; return *p; }                           // bitwise_ops == 1, should be 0
void sleeper(void) { [NSThread sleepForTimeInterval:1.0]; }             // state_halt_hits == 0, should be 1

Expected

Anchor ^ and & on binary-operator position between operands (not after (, = or ,, and not before {); add sleepForTimeInterval: to the sleep rule.

The same text-rule shape as #8866 (generics, strings); a class fix for the C-family & and ^ is worth doing once.

Part of #8863. Time the change; rosetta:rebless-owed if counts move; add each case as a test.

Activity

  1. added
    bug
    core-engine
    on Nov 21, 2026
  2. squid-protocol commented on Nov 23, 2026

    @squid-protocol
    OwnerAuthor

    This issue's PR content landed via #9111 (merged as fcc440b). It was a 'Part of' change, so the issue stays open for the remaining work.

  3. squid-protocol commented on Nov 24, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host melek, lease renewed 2026-11-24T12:53Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:melek label.

  4. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclaim:melekcore-enginepriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions