diff --git a/src/hotspot/share/code/dependencies.cpp b/src/hotspot/share/code/dependencies.cpp index 074846e2e7919..260da40b87a42 100644 --- a/src/hotspot/share/code/dependencies.cpp +++ b/src/hotspot/share/code/dependencies.cpp @@ -893,7 +893,7 @@ void Dependencies::DepStream::print_dependency(outputStream* st, Klass* witness, void Dependencies::DepStream::initial_asserts(size_t byte_limit) { assert(must_be_in_vm(), "raw oops here"); _byte_limit = byte_limit; - _type = (DepType)(end_marker-1); // defeat "already at end" assert + _type = undefined_dependency; // defeat "already at end" assert assert((_code!=nullptr) + (_deps!=nullptr) == 1, "one or t'other"); } #endif //ASSERT diff --git a/src/hotspot/share/code/dependencies.hpp b/src/hotspot/share/code/dependencies.hpp index 124db0b136933..d11c51a66dc66 100644 --- a/src/hotspot/share/code/dependencies.hpp +++ b/src/hotspot/share/code/dependencies.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2024, 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 @@ -103,6 +103,9 @@ class Dependencies: public ResourceObj { // type now includes N, that is, all super types of N. // enum DepType { + // _type is initially set to -1, to prevent "already at end" assert + undefined_dependency = -1, + end_marker = 0, // An 'evol' dependency simply notes that the contents of the