changeset 55617:6a1406c718ec

8221643: Tighten up assert(_keep_alive >= 0) in CLD::inc_keep_alive Reviewed-by: coleenp
author zgu
date Fri, 29 Mar 2019 14:17:09 -0400
parents 07212a29787a
children 8cd2af66ac7c
files src/hotspot/share/classfile/classLoaderData.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/classfile/classLoaderData.cpp	Fri Mar 29 18:00:31 2019 +0000
+++ b/src/hotspot/share/classfile/classLoaderData.cpp	Fri Mar 29 14:17:09 2019 -0400
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2019, 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
@@ -288,7 +288,7 @@
 // it is being defined, therefore _keep_alive is not volatile or atomic.
 void ClassLoaderData::inc_keep_alive() {
   if (is_unsafe_anonymous()) {
-    assert(_keep_alive >= 0, "Invalid keep alive increment count");
+    assert(_keep_alive > 0, "Invalid keep alive increment count");
     _keep_alive++;
   }
 }