projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68fea03
)
cpu: Assert asidx_from_attrs return value in range
author
Richard Henderson
<richard.henderson@linaro.org>
Fri, 29 Jun 2018 23:30:28 +0000
(16:30 -0700)
committer
Richard Henderson
<richard.henderson@linaro.org>
Mon, 2 Jul 2018 15:09:49 +0000
(08:09 -0700)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qom/cpu.h
patch
|
blob
|
history
diff --git
a/include/qom/cpu.h
b/include/qom/cpu.h
index cce2fd6acc2b9d70499e784ca795111c44c45ebb..bd796579ee40e7ae9fd43f11c1c55bca80d06fe0 100644
(file)
--- a/
include/qom/cpu.h
+++ b/
include/qom/cpu.h
@@
-620,11
+620,13
@@
static inline hwaddr cpu_get_phys_page_debug(CPUState *cpu, vaddr addr)
static inline int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
+ int ret = 0;
if (cc->asidx_from_attrs) {
- return cc->asidx_from_attrs(cpu, attrs);
+ ret = cc->asidx_from_attrs(cpu, attrs);
+ assert(ret < cpu->num_ases && ret >= 0);
}
- return
0
;
+ return
ret
;
}
#endif