From e4252bb91478e9c2f0a5bbdae7cd663838d91b1b Mon Sep 17 00:00:00 2001 From: Damon Fenacci Date: Fri, 27 Jan 2023 12:14:07 +0000 Subject: [PATCH] 8300823: UB: Compile::_phase_optimize_finished is initialized too late Reviewed-by: thartmann, chagedorn --- src/hotspot/share/opto/compile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 350ad144404..9548b3347bf 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, 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 @@ -977,6 +977,12 @@ void Compile::Init(bool aliasing) { _immutable_memory = NULL; // filled in at first inquiry +#ifdef ASSERT + _type_verify_symmetry = true; + _phase_optimize_finished = false; + _exception_backedge = false; +#endif + // Globally visible Nodes // First set TOP to NULL to give safe behavior during creation of RootNode set_cached_top_node(NULL); @@ -1070,12 +1076,6 @@ void Compile::Init(bool aliasing) { Copy::zero_to_bytes(_alias_cache, sizeof(_alias_cache)); // A NULL adr_type hits in the cache right away. Preload the right answer. probe_alias_cache(NULL)->_index = AliasIdxTop; - -#ifdef ASSERT - _type_verify_symmetry = true; - _phase_optimize_finished = false; - _exception_backedge = false; -#endif } //---------------------------init_start----------------------------------------