diff options
Diffstat (limited to 'results/classifier/108/other/1735')
| -rw-r--r-- | results/classifier/108/other/1735 | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/results/classifier/108/other/1735 b/results/classifier/108/other/1735 new file mode 100644 index 000000000..dffc6f508 --- /dev/null +++ b/results/classifier/108/other/1735 @@ -0,0 +1,44 @@ +permissions: 0.894 +vnc: 0.643 +PID: 0.609 +network: 0.415 +device: 0.391 +performance: 0.377 +graphic: 0.338 +socket: 0.293 +other: 0.290 +KVM: 0.288 +boot: 0.219 +debug: 0.216 +files: 0.214 +semantic: 0.168 + +[riscv-pmp] Pmp_hart_has_privs local variable name easily misunderstood +Additional information: +```c +// int => bool +static int pmp_is_in_range(CPURISCVState *env, int pmp_index, + target_ulong addr); + +bool pmp_hart_has_privs(CPURISCVState *env, target_ulong addr, + target_ulong size, pmp_priv_t privs, + pmp_priv_t *allowed_privs, target_ulong mode) +{ + int i = 0; + int pmp_size = 0; + // easily misunderstood local variable + target_ulong s = 0; + target_ulong e = 0; + + for (i = 0; i < MAX_RISCV_PMPS; i++) { + s = pmp_is_in_range(env, i, addr); + e = pmp_is_in_range(env, i, addr + pmp_size - 1); + + /* partially inside */ + if ((s + e) == 1) { + + } + + /* fully inside */ + if ((s + e) == 2) { +``` |