Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 55d680c

Browse files
offamitkumarMBaesken
authored andcommitted
8332461: ubsan : dependencies.cpp:906:3: runtime error: load of value 4294967295, which is not a valid value for type 'DepType'
Backport-of: 28de44d
1 parent fd43645 commit 55d680c

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
@@ -897,7 +897,7 @@ void Dependencies::DepStream::print_dependency(outputStream* st, Klass* witness,
897897
void Dependencies::DepStream::initial_asserts(size_t byte_limit) {
898898
assert(must_be_in_vm(), "raw oops here");
899899
_byte_limit = byte_limit;
900-
_type = (DepType)(end_marker-1); // defeat "already at end" assert
900+
_type = undefined_dependency; // defeat "already at end" assert
901901
assert((_code!=nullptr) + (_deps!=nullptr) == 1, "one or t'other");
902902
}
903903
#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)