mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 08:03:56 +00:00
base: avoid warnings about shift operations
clang: warning: The result of the '<<' expression is undefined
This commit is contained in:
committed by
Christian Helmuth
parent
4b62f091a9
commit
17f7147ac1
@ -178,6 +178,12 @@ void Capability_map::remove(Genode::addr_t const sel, uint8_t num_log_2,
|
||||
while (last_sel > last_range) {
|
||||
uint8_t left_log2 = log2(last_sel - last_range);
|
||||
|
||||
/* take care for a case which should not happen */
|
||||
if (left_log2 >= sizeof(last_range)*8) {
|
||||
error("cap remove error");
|
||||
return;
|
||||
}
|
||||
|
||||
remove(last_range, left_log2, revoke);
|
||||
|
||||
last_range += 1UL << left_log2;
|
||||
|
@ -40,8 +40,17 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
if (rcv_caps != ~0UL) {
|
||||
|
||||
/* calculate max order of caps to be received during reply */
|
||||
unsigned short log2_max = rcv_caps ? log2(rcv_caps) : 0;
|
||||
if ((1U << log2_max) < rcv_caps) log2_max ++;
|
||||
unsigned short log2_max = 0;
|
||||
if (rcv_caps) {
|
||||
log2_max = log2(rcv_caps);
|
||||
|
||||
/* if this happens, the call is bogus and invalid */
|
||||
if ((log2_max >= sizeof(rcv_caps) * 8))
|
||||
throw Ipc_error();
|
||||
|
||||
if ((1UL << log2_max) < rcv_caps)
|
||||
log2_max ++;
|
||||
}
|
||||
|
||||
rcv_window.rcv_wnd(log2_max);
|
||||
}
|
||||
|
Reference in New Issue
Block a user