8080401: Uninitialised variable in hotspot/src/os/solaris/dtrace/
Summary: reduce the warnings
Reviewed-by: sla, dsamersoff
--- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp Fri Aug 07 09:22:29 2015 -0700
@@ -134,7 +134,7 @@
}
void gen_prologue(GEN_variant gen_variant) {
- const char *suffix;
+ const char *suffix = "Undefined-Suffix";
switch(gen_variant) {
case GEN_OFFSET: suffix = ".h"; break;
--- a/hotspot/src/os/bsd/dtrace/jvm_dtrace.c Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/bsd/dtrace/jvm_dtrace.c Fri Aug 07 09:22:29 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, 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
@@ -227,7 +227,7 @@
/* attach to given JVM */
jvm_t* jvm_attach(pid_t pid) {
jvm_t* jvm;
- int door_fd, attach_fd, i;
+ int door_fd, attach_fd, i = 0;
jvm = (jvm_t*) calloc(1, sizeof(jvm_t));
if (jvm == NULL) {
@@ -292,14 +292,13 @@
/* detach the givenb JVM */
int jvm_detach(jvm_t* jvm) {
if (jvm) {
- int res;
+ int res = 0;
if (jvm->door_fd != -1) {
if (file_close(jvm->door_fd) != 0) {
set_jvm_error(JVM_ERR_CANT_CLOSE_DOOR);
res = -1;
} else {
clear_jvm_error();
- res = 0;
}
}
free(jvm);
--- a/hotspot/src/os/bsd/dtrace/libjvm_db.c Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c Fri Aug 07 09:22:29 2015 -0700
@@ -882,7 +882,7 @@
/* Finds a PcDesc with real-pc equal to N->pc */
static int pc_desc_at(Nmethod_t *N)
{
- uint64_t pc_diff;
+ uint64_t pc_diff = 999;
int32_t offs;
int32_t err;
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp Fri Aug 07 09:22:29 2015 -0700
@@ -129,7 +129,7 @@
}
void gen_prologue(GEN_variant gen_variant) {
- const char *suffix;
+ const char *suffix = "Undefined-Suffix";
switch(gen_variant) {
case GEN_OFFSET: suffix = ".h"; break;
--- a/hotspot/src/os/solaris/dtrace/jvm_dtrace.c Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/solaris/dtrace/jvm_dtrace.c Fri Aug 07 09:22:29 2015 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2015, 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
@@ -227,7 +227,7 @@
/* attach to given JVM */
jvm_t* jvm_attach(pid_t pid) {
jvm_t* jvm;
- int door_fd, attach_fd, i;
+ int door_fd, attach_fd, i = 0;
jvm = (jvm_t*) calloc(1, sizeof(jvm_t));
if (jvm == NULL) {
@@ -292,14 +292,13 @@
/* detach the givenb JVM */
int jvm_detach(jvm_t* jvm) {
if (jvm) {
- int res;
+ int res = 0;
if (jvm->door_fd != -1) {
if (file_close(jvm->door_fd) != 0) {
set_jvm_error(JVM_ERR_CANT_CLOSE_DOOR);
res = -1;
} else {
clear_jvm_error();
- res = 0;
}
}
free(jvm);
--- a/hotspot/src/os/solaris/dtrace/libjvm_db.c Fri Aug 07 09:21:32 2015 -0700
+++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c Fri Aug 07 09:22:29 2015 -0700
@@ -882,7 +882,7 @@
/* Finds a PcDesc with real-pc equal to N->pc */
static int pc_desc_at(Nmethod_t *N)
{
- uint64_t pc_diff;
+ uint64_t pc_diff = 999;
int32_t offs;
int32_t err;