* removed (already unused, because of never taken branch) handling of

interfacecom in subscriptnodes, because a COM interface cannot have fields
    -> replaced with check (that actually is performed) to give an
    internalerror() should a reference-counted class type be subscripted

git-svn-id: trunk@16786 -
This commit is contained in:
Jonas Maebe 2011-01-19 14:50:17 +00:00
parent 88fe11958b
commit 9a6f574f06

View File

@ -293,6 +293,8 @@ implementation
paraloc1.init;
{ several object types must be dereferenced implicitly }
if is_implicit_pointer_object_type(left.resultdef) then
begin
if not is_managed_type(left.resultdef) then
begin
{ the contents of a class are aligned to a sizeof(pointer) }
location_reset_ref(location,LOC_REFERENCE,def_cgsize(resultdef),sizeof(pint));
@ -338,23 +340,11 @@ implementation
cg.deallocallcpuregisters(current_asmdata.CurrAsmList);
end;
end
else if is_interfacecom(left.resultdef) then
begin
location_reset_ref(location,LOC_REFERENCE,def_cgsize(resultdef),sizeof(pint));
tg.GetTempTyped(current_asmdata.CurrAsmList,left.resultdef,tt_normal,location.reference);
cg.a_load_loc_ref(current_asmdata.CurrAsmList,OS_ADDR,left.location,location.reference);
{ implicit deferencing also for interfaces }
if (cs_use_heaptrc in current_settings.globalswitches) and
(cs_checkpointer in current_settings.localswitches) and
not(cs_compilesystem in current_settings.moduleswitches) then
begin
paramanager.getintparaloc(pocall_default,1,paraloc1);
cg.a_load_reg_cgpara(current_asmdata.CurrAsmList, OS_ADDR,location.reference.base,paraloc1);
paramanager.freecgpara(current_asmdata.CurrAsmList,paraloc1);
cg.allocallcpuregisters(current_asmdata.CurrAsmList);
cg.a_call_name(current_asmdata.CurrAsmList,'FPC_CHECKPOINTER',false);
cg.deallocallcpuregisters(current_asmdata.CurrAsmList);
end;
else
{ reference-counted implicit pointer object types don't have
fields -> cannot be subscripted (calls are handled via call
nodes) }
internalerror(2011011901);
end
else
begin