Mercurial > hg > graal-jvmci-8
diff src/share/vm/opto/library_call.cpp @ 23055:c1c199dde5c9
8077504: Unsafe load can loose control dependency and cause crash
Summary: Node::depends_only_on_test() should return false for Unsafe loads
Reviewed-by: kvn, adinn
author | roland |
---|---|
date | Wed, 03 Jun 2015 14:22:57 +0200 |
parents | d9593687713d |
children | bf41eee321e5 |
line wrap: on
line diff
--- a/src/share/vm/opto/library_call.cpp Tue May 06 09:17:57 2014 +0200 +++ b/src/share/vm/opto/library_call.cpp Wed Jun 03 14:22:57 2015 +0200 @@ -2669,7 +2669,9 @@ if (!is_store) { MemNode::MemOrd mo = is_volatile ? MemNode::acquire : MemNode::unordered; - Node* p = make_load(control(), adr, value_type, type, adr_type, mo, is_volatile); + // To be valid, unsafe loads may depend on other conditions than + // the one that guards them: pin the Load node + Node* p = make_load(control(), adr, value_type, type, adr_type, mo, LoadNode::Pinned, is_volatile); // load value switch (type) { case T_BOOLEAN: @@ -6038,7 +6040,7 @@ } // Build the load. MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered; - Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, is_vol); + Node* loadedField = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol); // If reference is volatile, prevent following memory ops from // floating up past the volatile read. Also prevents commoning // another volatile read.