8164692: InstanceKlass::_previous_version_count goes negative

Decrement previous_version_count when it's removed from the list.

Reviewed-by: dcubed, dlong, sspitsyn
This commit is contained in:
Coleen Phillimore 2016-08-31 06:35:19 -04:00
parent ab538ab5ed
commit 31d8fcc4f9
4 changed files with 74 additions and 8 deletions

View file

@ -771,7 +771,10 @@ public:
static int _previous_version_count;
public:
static void purge_previous_versions(InstanceKlass* ik);
static bool has_previous_versions() { return _previous_version_count > 0; }
static bool has_previous_versions() {
assert(_previous_version_count >= 0, "count should never be negative");
return _previous_version_count > 0;
}
// JVMTI: Support for caching a class file before it is modified by an agent that can do retransformation
void set_cached_class_file(JvmtiCachedClassFileData *data) {