6876037: CTW fails jdk7/hotspot/src/share/vm/opto/type.cpp:2055. assert(bits,"Use TypePtr for NULL")
Summary: Add missing 0 value check in TypeRawPtr::add_offset().
Reviewed-by: never
--- a/hotspot/src/share/vm/opto/type.cpp Fri Jan 07 10:16:57 2011 -0800
+++ b/hotspot/src/share/vm/opto/type.cpp Fri Jan 07 11:53:24 2011 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, 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
@@ -2187,8 +2187,11 @@
case TypePtr::NotNull:
return this;
case TypePtr::Null:
- case TypePtr::Constant:
- return make( _bits+offset );
+ case TypePtr::Constant: {
+ address bits = _bits+offset;
+ if ( bits == 0 ) return TypePtr::NULL_PTR;
+ return make( bits );
+ }
default: ShouldNotReachHere();
}
return NULL; // Lint noise