Skip to content

Commit 0e7ebcb

Browse files
kiriyamagnu-andrew
authored andcommitted
8317291: Missing null check for nmethod::is_native_method()
Reviewed-by: phh, andrew
1 parent eace2d7 commit 0e7ebcb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hotspot/src/share/vm/code/nmethod.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2023, 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
@@ -363,8 +363,8 @@ class nmethod : public CodeBlob {
363363

364364
// type info
365365
bool is_nmethod() const { return true; }
366-
bool is_java_method() const { return !method()->is_native(); }
367-
bool is_native_method() const { return method()->is_native(); }
366+
bool is_java_method() const { return _method != NULL && !method()->is_native(); }
367+
bool is_native_method() const { return _method != NULL && method()->is_native(); }
368368
bool is_osr_method() const { return _entry_bci != InvocationEntryBci; }
369369

370370
bool is_compiled_by_c1() const;

0 commit comments

Comments
 (0)