From 0d2f7f6216f2cf6b8cd18d8e0d51a1458097784f Mon Sep 17 00:00:00 2001 From: Leo Korinth Date: Mon, 9 Mar 2026 15:57:33 +0000 Subject: [PATCH] 8377995: ZGC: Fix implicit narrowing conversion in zBitField Reviewed-by: stefank, aboldtch --- src/hotspot/share/gc/z/zBitField.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/gc/z/zBitField.hpp b/src/hotspot/share/gc/z/zBitField.hpp index 9bec4e05594..b68f5b92ce1 100644 --- a/src/hotspot/share/gc/z/zBitField.hpp +++ b/src/hotspot/share/gc/z/zBitField.hpp @@ -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)value >> ValueShift) << FieldShift); } };