diff --git a/compiler/ncginl.pas b/compiler/ncginl.pas index d369891b12..064e21518a 100644 --- a/compiler/ncginl.pas +++ b/compiler/ncginl.pas @@ -444,6 +444,8 @@ implementation { when constant, just multiply the addvalue } if is_constintnode(tcallparanode(tcallparanode(left).right).left) then addvalue:=addvalue*get_ordinal_value(tcallparanode(tcallparanode(left).right).left) + else if is_constpointernode(tcallparanode(tcallparanode(left).right).left) then + addvalue:=addvalue*tpointerconstnode(tcallparanode(tcallparanode(left).right).left).value else begin location_force_reg(current_asmdata.CurrAsmList,tcallparanode(tcallparanode(left).right).left.location,cgsize,addvalue<=1); diff --git a/compiler/node.pas b/compiler/node.pas index e3bcabde0b..15136e451b 100644 --- a/compiler/node.pas +++ b/compiler/node.pas @@ -460,6 +460,7 @@ interface function is_constboolnode(p : tnode) : boolean; function is_constenumnode(p : tnode) : boolean; function is_constwidecharnode(p : tnode) : boolean; + function is_constpointernode(p : tnode) : boolean; implementation @@ -670,6 +671,13 @@ implementation is_constenumnode:=(p.nodetype=ordconstn) and (p.resultdef.typ=enumdef); end; + + function is_constpointernode(p : tnode) : boolean; + begin + is_constpointernode:=(p.nodetype=pointerconstn); + end; + + {**************************************************************************** TNODE ****************************************************************************}