mirror of https://github.com/xemu-project/xemu.git
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
|
@ -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…
Reference in New Issue