|
@@ -633,8 +633,17 @@ implementation
|
|
|
typecheckpass(p);
|
|
|
end;
|
|
|
{ several object types have implicit dereferencing }
|
|
|
- hasimplicitderef:=is_implicit_pointer_object_type(p.resultdef) or
|
|
|
- (p.resultdef.typ = classrefdef);
|
|
|
+ { is_implicit_pointer_object_type() returns true for records
|
|
|
+ on the JVM target because they are implemented as classes
|
|
|
+ there, but we definitely have to take their address here
|
|
|
+ since otherwise a deep copy is made and changes are made to
|
|
|
+ this copy rather than to the original one }
|
|
|
+ hasimplicitderef:=
|
|
|
+ (is_implicit_pointer_object_type(p.resultdef) or
|
|
|
+ (p.resultdef.typ=classrefdef)) and
|
|
|
+ not((target_info.system in systems_jvm) and
|
|
|
+ ((p.resultdef.typ=recorddef) or
|
|
|
+ is_object(p.resultdef)));
|
|
|
if hasimplicitderef then
|
|
|
hdef:=p.resultdef
|
|
|
else
|