Skip to content
Commit 3964994b authored by Eric Sesterhenn / Snakebyte's avatar Eric Sesterhenn / Snakebyte Committed by Avi Kivity
Browse files

KVM: Fix overflow bug in overflow detection code



The expression

   sp - 6 < sp

where sp is a u16 is undefined in C since 'sp - 6' is promoted to int,
and signed overflow is undefined in C.  gcc 4.2 actually warns about it.
Replace with a simpler test.

Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 5008fdf5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment