Skip to content

Commit

Permalink
8332461: ubsan : dependencies.cpp:906:3: runtime error: load of value…
Browse files Browse the repository at this point in the history
… 4294967295, which is not a valid value for type 'DepType'

Reviewed-by: stefank, kvn, dlong
  • Loading branch information
offamitkumar committed Sep 5, 2024
1 parent 96df5a6 commit 28de44d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/code/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/hotspot/share/code/dependencies.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 28de44d

Please sign in to comment.