Fix generic data class hashCode for null

Null may come from everywhere, so we always check for it (when the property's
type is not primitive)
This commit is contained in:
Alexander Udalov
2013-02-06 16:12:22 +04:00
parent 1021ec5ff4
commit 8697adb28a
3 changed files with 15 additions and 3 deletions
@@ -506,14 +506,14 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
genPropertyOnStack(iv, propertyDescriptor, 0);
Label ifNull = null;
if (propertyDescriptor.getType().isNullable()) {
Type asmType = typeMapper.mapType(propertyDescriptor.getType());
if (!isPrimitive(asmType)) {
ifNull = new Label();
iv.dup();
iv.ifnull(ifNull);
}
genHashCode(mv, iv, typeMapper.mapType(propertyDescriptor.getType()));
genHashCode(mv, iv, asmType);
if (ifNull != null) {
Label end = new Label();