8262466: linux libsaproc/DwarfParser.cpp delete DwarfParser object in early return
Reviewed-by: ysuenaga, kevinw
This commit is contained in:
parent
c15801e98c
commit
0265ab63e4
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2020, NTT DATA.
|
* Copyright (c) 2020, 2021, NTT DATA.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -99,14 +99,13 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_ini
|
|||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_createDwarfContext
|
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_linux_amd64_DwarfParser_createDwarfContext
|
||||||
(JNIEnv *env, jclass this_cls, jlong lib) {
|
(JNIEnv *env, jclass this_cls, jlong lib) {
|
||||||
jlong result = 0L;
|
|
||||||
|
|
||||||
DwarfParser *parser = new DwarfParser(reinterpret_cast<lib_info *>(lib));
|
DwarfParser *parser = new DwarfParser(reinterpret_cast<lib_info *>(lib));
|
||||||
if (!parser->is_parseable()) {
|
if (!parser->is_parseable()) {
|
||||||
jclass ex_cls = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
|
jclass ex_cls = env->FindClass("sun/jvm/hotspot/debugger/DebuggerException");
|
||||||
if (!env->ExceptionOccurred()) {
|
if (!env->ExceptionOccurred()) {
|
||||||
env->ThrowNew(ex_cls, "DWARF not found");
|
env->ThrowNew(ex_cls, "DWARF not found");
|
||||||
}
|
}
|
||||||
|
delete parser;
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user