changeset 8987:fbc668a76c00

8211394: CHECK_ must be used in the rhs of an assignment statement within a block Summary: Backport from JDK12 Reviewed-by: dholmes
author phh
date Wed, 17 Oct 2018 16:31:25 -0400
parents 451871d094b9
children be27fec0948c
files src/share/vm/classfile/verificationType.cpp src/share/vm/utilities/exceptions.hpp
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/verificationType.cpp	Tue Oct 16 16:08:14 2018 +0100
+++ b/src/share/vm/classfile/verificationType.cpp	Wed Oct 17 16:31:25 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -99,7 +99,7 @@
     VerificationType comp_from = from.get_component(context, CHECK_false);
     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
       return comp_this.is_assignable_from(comp_from, context,
-                                          from_field_is_protected, CHECK_false);
+                                          from_field_is_protected, TRAPS);
     }
   }
   return false;
--- a/src/share/vm/utilities/exceptions.hpp	Tue Oct 16 16:08:14 2018 +0100
+++ b/src/share/vm/utilities/exceptions.hpp	Wed Oct 17 16:31:25 2018 -0400
@@ -201,7 +201,7 @@
 //
 // CAUTION: make sure that the function call using a CHECK macro is not the only statement of a
 // conditional branch w/o enclosing {} braces, since the CHECK macros expand into several state-
-// ments!
+// ments! Also make sure it is not used on a function call that is part of a return statement!
 
 #define PENDING_EXCEPTION                        (((ThreadShadow*)THREAD)->pending_exception())
 #define HAS_PENDING_EXCEPTION                    (((ThreadShadow*)THREAD)->has_pending_exception())