Skip to content

Commit 28de44d

Browse files
committed
8332461: ubsan : dependencies.cpp:906:3: runtime error: load of value 4294967295, which is not a valid value for type 'DepType'
Reviewed-by: stefank, kvn, dlong
1 parent 96df5a6 commit 28de44d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/hotspot/share/code/dependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ void Dependencies::DepStream::print_dependency(outputStream* st, Klass* witness,
893893
void Dependencies::DepStream::initial_asserts(size_t byte_limit) {
894894
assert(must_be_in_vm(), "raw oops here");
895895
_byte_limit = byte_limit;
896-
_type = (DepType)(end_marker-1); // defeat "already at end" assert
896+
_type = undefined_dependency; // defeat "already at end" assert
897897
assert((_code!=nullptr) + (_deps!=nullptr) == 1, "one or t'other");
898898
}
899899
#endif //ASSERT

src/hotspot/share/code/dependencies.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -103,6 +103,9 @@ class Dependencies: public ResourceObj {
103103
// type now includes N, that is, all super types of N.
104104
//
105105
enum DepType {
106+
// _type is initially set to -1, to prevent "already at end" assert
107+
undefined_dependency = -1,
108+
106109
end_marker = 0,
107110

108111
// An 'evol' dependency simply notes that the contents of the

0 commit comments

Comments
 (0)