mirror of
https://github.com/clearlinux/graphene.git
synced 2026-10-03 15:39:36 +00:00
No suffix to integer literals cause overflow (#251)
a left shift operator applys on a literal number 1 cause overflow so unsigned long long type suffix should be appended to that literal that makes it has same type as xfrm and xfrm for safety
This commit is contained in:
@@ -90,7 +90,7 @@ static size_t get_ssaframesize (uint64_t xfrm)
|
||||
xfrm_ex = ((uint64_t) cpuinfo[3] << 32) + cpuinfo[2];
|
||||
|
||||
for (int i = 2; i < 64; i++)
|
||||
if ((xfrm & (1 << i)) || (xfrm_ex & (1 << i))) {
|
||||
if ((xfrm & (1ULL << i)) || (xfrm_ex & (1ULL << i))) {
|
||||
cpuid(0xd, i, cpuinfo);
|
||||
if (cpuinfo[0] + cpuinfo[1] > xsave_size)
|
||||
xsave_size = cpuinfo[0] + cpuinfo[1];
|
||||
|
||||
Reference in New Issue
Block a user