Browse Source

* we only support resourcestrings in ttai_typedconstbuilder.queue_emit_const()
right now, so give an internalerror if something else is passed
* use the correct type when emitting a resourcestring like that (it will store
the address of the resource string -> pointer to an ansistring)

git-svn-id: trunk@31646 -

Jonas Maebe 10 years ago
parent
commit
7def77dcc9
1 changed files with 12 additions and 1 deletions
  1. 12 1
      compiler/aasmcnst.pas

+ 12 - 1
compiler/aasmcnst.pas

@@ -1570,7 +1570,18 @@ implementation
        if fqueue_offset<>0 then
          internalerror(2014062103);
        { warning: update if/when the type of resource strings changes }
-       emit_tai(Tai_const.Createname(make_mangledname('RESSTR',cs.owner,cs.name),AT_DATA,sizeof(pint)),cansistringtype);
+       case cs.consttyp of
+         constresourcestring:
+           emit_tai(Tai_const.Createname(make_mangledname('RESSTR',cs.owner,cs.name),AT_DATA,sizeof(pint)),cpointerdef.getreusable(cansistringtype));
+         { can these occur? }
+         constord,
+         conststring,constreal,
+         constset,constpointer,constnil,
+         constwstring,constguid:
+           internalerror(2015090903);
+         else
+           internalerror(2015090904);
+       end;
        fqueue_offset:=low(fqueue_offset);
      end;