Skip to content

Commit 9b6f6c5

Browse files
author
Kim Barrett
committed
8336082: Fix -Wzero-as-null-pointer-constant warnings in SimpleCompactHashtable
Reviewed-by: coleenp, dholmes
1 parent 7a62032 commit 9b6f6c5

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/hotspot/share/classfile/compactHashtable.hpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 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
@@ -204,18 +204,20 @@ class SimpleCompactHashtable {
204204
u4* _entries;
205205

206206
public:
207-
SimpleCompactHashtable() {
208-
_entry_count = 0;
209-
_bucket_count = 0;
210-
_buckets = 0;
211-
_entries = 0;
212-
}
207+
SimpleCompactHashtable() :
208+
_base_address(nullptr),
209+
_bucket_count(0),
210+
_entry_count(0),
211+
_buckets(nullptr),
212+
_entries(nullptr)
213+
{}
213214

214215
void reset() {
216+
_base_address = nullptr;
215217
_bucket_count = 0;
216218
_entry_count = 0;
217-
_buckets = 0;
218-
_entries = 0;
219+
_buckets = nullptr;
220+
_entries = nullptr;
219221
}
220222

221223
void init(address base_address, u4 entry_count, u4 bucket_count, u4* buckets, u4* entries);

0 commit comments

Comments
 (0)