Skip to content

Commit

Permalink
8300823: UB: Compile::_phase_optimize_finished is initialized too late
Browse files Browse the repository at this point in the history
Reviewed-by: thartmann, chagedorn
  • Loading branch information
dafedafe authored and TobiHartmann committed Jan 27, 2023
1 parent db8fa1b commit e4252bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions 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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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----------------------------------------
Expand Down

3 comments on commit e4252bb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on e4252bb Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on e4252bb Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin Could not automatically backport e4252bb9 to openjdk/jdk17u-dev due to conflicts in the following files:

  • src/hotspot/share/opto/compile.cpp

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk17u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk17u-dev.git master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b GoeLin-backport-e4252bb9

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk.git e4252bb91478e9c2f0a5bbdae7cd663838d91b1b

# Backport the commit
$ git cherry-pick --no-commit e4252bb91478e9c2f0a5bbdae7cd663838d91b1b
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport e4252bb91478e9c2f0a5bbdae7cd663838d91b1b'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk17u-dev with the title Backport e4252bb91478e9c2f0a5bbdae7cd663838d91b1b.

Please sign in to comment.