Bug#588711: /usr/bin/clang: incorrect implementation of __builtin_expect()

Mark Heily mark at heily.com
Sun Jul 11 13:49:30 UTC 2010


Package: clang
Version: 2.6-3
Severity: normal
File: /usr/bin/clang

The prototype of the __builtin_expect() macro is supposed to be:

    long __builtin_expect(long exp, long c);

In clang 2.6 this is incorrectly implemented as:

    int __builtin_expect(int exp, int c);

This can cause a silent integer overflow with values of exp larger than 
INT_MAX on a 64-bit platform. Upstream has committed a fix in SVN r85666, 
and the fix is incorporated into clang 2.7.

The libdispatch package has been patched to workaround this bug.





More information about the Pkg-llvm-team mailing list