mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 02:07:53 +02:00
default(): fix webtbf/tw37303 after previous changes
This commit is contained in:
parent
1be7416816
commit
2476062198
@ -446,12 +446,6 @@ implementation
|
||||
((def.typ=objectdef) and not is_object(def)) then
|
||||
internalerror(201202101);
|
||||
|
||||
if df_generic in current_procinfo.procdef.defoptions then
|
||||
begin
|
||||
result:=cpointerconstnode.create(0,def);
|
||||
exit;
|
||||
end;
|
||||
|
||||
{ extra '$' prefix because on darwin the result of makemangledname
|
||||
is prefixed by '_' and hence adding a '$' at the start of the
|
||||
prefix passed to makemangledname doesn't help (the whole point of
|
||||
@ -511,7 +505,16 @@ implementation
|
||||
pointerdef:
|
||||
result:=cpointerconstnode.create(0,def);
|
||||
procvardef:
|
||||
if tprocvardef(def).size<>sizeof(pint) then
|
||||
if df_generic in current_procinfo.procdef.defoptions then
|
||||
begin
|
||||
{ don't allow as a default parameter value }
|
||||
if block_type<>bt_const then
|
||||
result:=cpointerconstnode.create(0,def)
|
||||
else
|
||||
result:=cerrornode.create;
|
||||
exit;
|
||||
end
|
||||
else if tprocvardef(def).size<>sizeof(pint) then
|
||||
result:=getdefaultvarsym(def)
|
||||
else
|
||||
result:=cpointerconstnode.create(0,def);
|
||||
|
Loading…
Reference in New Issue
Block a user