From 39abac98f9803897e40c32d5bcb35bd25c348d2a Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Thu, 29 Apr 2021 07:59:35 +0000 Subject: [PATCH] 8266176: -Wmaybe-uninitialized happens in libArrayIndexOutOfBoundsExceptionTest.c Reviewed-by: dholmes --- .../libArrayIndexOutOfBoundsExceptionTest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/libArrayIndexOutOfBoundsExceptionTest.c b/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/libArrayIndexOutOfBoundsExceptionTest.c index a2ef2ee79a5..23afb360662 100644 --- a/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/libArrayIndexOutOfBoundsExceptionTest.c +++ b/test/hotspot/jtreg/runtime/exceptionMsgs/ArrayIndexOutOfBoundsException/libArrayIndexOutOfBoundsExceptionTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -47,7 +47,7 @@ JNIEXPORT void JNICALL \ JNIEXPORT void JNICALL \ Java_ArrayIndexOutOfBoundsExceptionTest_doNative##NameType##ArrayRegionStore(JNIEnv *env, jclass klass, \ ElementType##Array array, jint start, jint len) { \ - ElementType content[100]; \ + ElementType content[100] = {0}; \ (*env)->Set##NameType##ArrayRegion(env, array, start, len, content); \ }