mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-28 07:41:10 +00:00
8377995: ZGC: Fix implicit narrowing conversion in zBitField
Reviewed-by: stefank, aboldtch
This commit is contained in:
parent
a278ad8fff
commit
0d2f7f6216
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
static ContainerType encode(ValueType value) {
|
||||
assert(((ContainerType)value & (FieldMask << ValueShift)) == (ContainerType)value, "Invalid value");
|
||||
return ((ContainerType)value >> ValueShift) << FieldShift;
|
||||
return checked_cast<ContainerType>(((ContainerType)value >> ValueShift) << FieldShift);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user