mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
accel/tcg: Validate placement of CPUNegativeOffsetState
Verify that the distance between CPUNegativeOffsetState and CPUArchState is no greater than any alignment requirements. Reviewed-by: Anton Johansson <anjo@rev.ng> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
f669c99241
commit
5d30bdcb1b
1 changed files with 6 additions and 0 deletions
|
@ -457,6 +457,12 @@ static inline CPUState *env_cpu(CPUArchState *env)
|
||||||
return &env_archcpu(env)->parent_obj;
|
return &env_archcpu(env)->parent_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Validate placement of CPUNegativeOffsetState.
|
||||||
|
*/
|
||||||
|
QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) - offsetof(ArchCPU, neg) >=
|
||||||
|
sizeof(CPUNegativeOffsetState) + __alignof(CPUArchState));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* env_neg(env)
|
* env_neg(env)
|
||||||
* @env: The architecture environment
|
* @env: The architecture environment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue