* syscall.cc (ffs): Fix crash of ffs (0x80000000) on 64 bit.
This commit is contained in:
parent
2bf7d695ea
commit
2fb56bbfaa
|
@ -1,3 +1,7 @@
|
|||
2014-10-08 Christian Franke <franke@computer.org>
|
||||
|
||||
* syscall.cc (ffs): Fix crash of ffs (0x80000000) on 64 bit.
|
||||
|
||||
2014-10-08 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_process.cc (format_process_statm): Fix output of dirty
|
||||
|
|
|
@ -3847,10 +3847,9 @@ ffs (int i)
|
|||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
||||
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
|
||||
};
|
||||
unsigned long int a;
|
||||
unsigned long int x = i & -i;
|
||||
unsigned x = i & -i;
|
||||
|
||||
a = x <= 0xffff ? (x <= 0xff ? 0 : 8) : (x <= 0xffffff ? 16 : 24);
|
||||
int a = x <= 0xffff ? (x <= 0xff ? 0 : 8) : (x <= 0xffffff ? 16 : 24);
|
||||
|
||||
return table[x >> a] + a;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue