Browse Source

* pack ansi/wide/unicodestring "records" at 1 byte so that we don't "pad"
the string to a multiple of sizeof(pint) (the string record itself is still
aligned to a multiple of that)

git-svn-id: branches/hlcgllvm@28766 -

Jonas Maebe 10 years ago
parent
commit
2ed100666d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/aasmcnst.pas

+ 3 - 1
compiler/aasmcnst.pas

@@ -801,7 +801,9 @@ implementation
        current_asmdata.getdatalabel(result.lab);
        current_asmdata.getdatalabel(result.lab);
        startlab:=result.lab;
        startlab:=result.lab;
        result.ofs:=0;
        result.ofs:=0;
-       begin_anonymous_record('$'+get_dynstring_rec_name(stringtype,false,len),sizeof(pint));
+       { pack the data, so that we don't add unnecessary null bytes after the
+         constant string }
+       begin_anonymous_record('$'+get_dynstring_rec_name(stringtype,false,len),1);
        string_symofs:=get_string_symofs(stringtype,false);
        string_symofs:=get_string_symofs(stringtype,false);
        { encoding }
        { encoding }
        emit_tai(tai_const.create_16bit(encoding),u16inttype);
        emit_tai(tai_const.create_16bit(encoding),u16inttype);