The problem is that time_t is signed, and the original code relied on the
fact that (X + c < X) in case of overflow for c >= 0. Unfortunately, this
condition is only guaranteed by the standard for unsigned arithmetic, and
the gcc 4.4.0 optimizer did completely remove the corresponding test from
the code. This resulted in a missing boundary check, and an infinite loop.
The problem is solved by testing explicitely for TIME_T_MIN and TIME_T_MAX
in the loop that uses this.
Also fix increment_overflow and long_increment_overflow which were buggy
for exactly the same reasons.
Also remove some compiler warnings.
Note: a similar fix was performed in bionic/libc
Merge commit '3ebc52eb710c75a1ef51dca7c767701bab74a9ee'
* commit '3ebc52eb710c75a1ef51dca7c767701bab74a9ee':
Fix a bug that prevented the "generic" product builds from working in the emulator.
Merge commit '2f21659d4565afd65da1be07c28317a3cb4287a1' into eclair-plus-aosp
* commit '2f21659d4565afd65da1be07c28317a3cb4287a1':
Fix a bug that prevented the "generic" product builds from working in the emulator.
Merge commit '24e78ecfb93bceea39c2d58af5eae2aa6467d395'
* commit '24e78ecfb93bceea39c2d58af5eae2aa6467d395':
Move ARM disassembler out of libacc and into the acc command-line tool.
Merge commit '983b8bb01c3abc8e338f7779ee62fd6aab2f56a0'
* commit '983b8bb01c3abc8e338f7779ee62fd6aab2f56a0':
Fix a call to memset(3) with reversed arguments.
Merge commit 'b97d616d028f801b6e914c9a29d9177de2177020'
* commit 'b97d616d028f801b6e914c9a29d9177de2177020':
Added a hack that makes the SD card world-writable when the sampling
Merge commit 'aae43f9e7582a403b8c4f20d59e26c36bbde5219'
* commit 'aae43f9e7582a403b8c4f20d59e26c36bbde5219':
init.rc: Make /data/dontpanic files readable only by the system process.
Merge commit '0e1f612d5d5caca3f8c8d7f1689a96148a24afd2' into eclair-plus-aosp
* commit '0e1f612d5d5caca3f8c8d7f1689a96148a24afd2':
Move ARM disassembler out of libacc and into the acc command-line tool.
ARMv6 onwards. These architectures provide the load-linked, store-conditional pair of ldrex/strex whose use
is recommended in place of 'swp'. Also, the description of the 'swp' instruction in the ARMv6 reference
manual states that the swap operation does not include any memory barrier guarantees.This fix attempts to
address these issues by providing an atomic swap implementation using ldrex/strex under _ARM_HAVE_LDREX_STREX
macro. _ARM_HAVE_LDREX_STREX macro is defined in cpu-features.h file and patch is submitted under change ID 11088.
This Fix is verified on ST Ericsson's U8500 platform and Submitted on behalf of a third-party:
Surinder-pal SINGH from STMicroelectronics.
Merge commit 'd9a16d6e7daf8e58ebc7760530d9b015dbe4678d' into eclair-plus-aosp
* commit 'd9a16d6e7daf8e58ebc7760530d9b015dbe4678d':
Fix a call to memset(3) with reversed arguments.
Merge commit 'd62ae8f12f7b6b7fa13366a064ad4d483a3312e5' into eclair-plus-aosp
* commit 'd62ae8f12f7b6b7fa13366a064ad4d483a3312e5':
Added a hack that makes the SD card world-writable when the sampling
* changes:
Added a hack that makes the SD card world-writable when the sampling profiler is turned out. I'll remove this once egnor has the drop box in system_server working.
Merge commit '9332482ed2945174d94615f0720f88702cb92667' into eclair-plus-aosp
* commit '9332482ed2945174d94615f0720f88702cb92667':
init.rc: Make /data/dontpanic files readable only by the system process.
This also ensures that emulator-specific files /init.goldfish.rc and
/system/etc/init.goldfish.sh are never part of -user builds, which
correspond to production devices.
Merge commit 'ef41d2381ddf5cf6a1ad2cfd531cac8b943d20fc'
* commit 'ef41d2381ddf5cf6a1ad2cfd531cac8b943d20fc':
Turn an assert into an error to handle bad struct members more gracefully.
Merge commit '45a35237f34c92f8e51eb42eb01e3a054d20aa23'
* commit '45a35237f34c92f8e51eb42eb01e3a054d20aa23':
Generate an error for the use of an undeclared struct.
Merge commit 'c0b74902b85c538c9dac549aa5b213a3fb3edc57' into eclair-plus-aosp
* commit 'c0b74902b85c538c9dac549aa5b213a3fb3edc57':
Turn an assert into an error to handle bad struct members more gracefully.
Merge commit '5f324384027f1d753eeaada3e05ece236a095384' into eclair-plus-aosp
* commit '5f324384027f1d753eeaada3e05ece236a095384':
Generate an error for the use of an undeclared struct.
Merge commit 'bb59b7a5c9444c4fccae10d5a4b00165d47007eb'
* commit 'bb59b7a5c9444c4fccae10d5a4b00165d47007eb':
android_atomic_write() implementation was using cmpxchg which was useless
Merge commit '4599c1ff56b1962eecfe647da26e922c0fe2fa13' into eclair-plus-aosp
* commit '4599c1ff56b1962eecfe647da26e922c0fe2fa13':
android_atomic_write() implementation was using cmpxchg which was useless
Merge commit 'dfd31ee89975a3307c088f7a69a63b93381e2758' into eclair-plus-aosp
* commit 'dfd31ee89975a3307c088f7a69a63b93381e2758':
Improve error message for unknown struct members
Until now the address operator only worked with simple variables.
Now it works with arbitrary expressions (that are lvalues or function
names). So for example this now works:
struct S { int a[10]};
int f(struct S* p) {
return &p->a[3];
}
Merge commit 'c62592bb46dc0dc112fb5211d97799ffd3e2dcde' into eclair-plus-aosp
* commit 'c62592bb46dc0dc112fb5211d97799ffd3e2dcde':
Add contacts aggregation event to the log.