mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8373820: C2: Robust Node::uncast_helper infinite loop check
Reviewed-by: qamai, chagedorn
This commit is contained in:
parent
d8eb1259f4
commit
4f283f188c
@ -999,18 +999,22 @@ bool Node::has_out_with(int opcode1, int opcode2, int opcode3, int opcode4) {
|
||||
//---------------------------uncast_helper-------------------------------------
|
||||
Node* Node::uncast_helper(const Node* p, bool keep_deps) {
|
||||
#ifdef ASSERT
|
||||
// If we end up traversing more nodes than we actually have,
|
||||
// it is definitely an infinite loop.
|
||||
uint max_depth = Compile::current()->unique();
|
||||
uint depth_count = 0;
|
||||
const Node* orig_p = p;
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
#ifdef ASSERT
|
||||
if (depth_count >= K) {
|
||||
if (depth_count++ >= max_depth) {
|
||||
orig_p->dump(4);
|
||||
if (p != orig_p)
|
||||
if (p != orig_p) {
|
||||
p->dump(1);
|
||||
}
|
||||
fatal("infinite loop in Node::uncast_helper");
|
||||
}
|
||||
assert(depth_count++ < K, "infinite loop in Node::uncast_helper");
|
||||
#endif
|
||||
if (p == nullptr || p->req() != 2) {
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user