Procházet zdrojové kódy

* handle exports with a name consisting of a single character correctly

git-svn-id: trunk@21945 -
florian před 13 roky
rodič
revize
9672f0537a
3 změnil soubory, kde provedl 14 přidání a 0 odebrání
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/pexports.pas
  3. 11 0
      tests/tbs/tb0582.pp

+ 1 - 0
.gitattributes

@@ -9585,6 +9585,7 @@ tests/tbs/tb0578.pp svneol=native#text/pascal
 tests/tbs/tb0579.pp svneol=native#text/pascal
 tests/tbs/tb0580.pp svneol=native#text/pascal
 tests/tbs/tb0581.pp svneol=native#text/plain
+tests/tbs/tb0582.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain

+ 2 - 0
compiler/pexports.pas

@@ -163,6 +163,8 @@ implementation
                        pt:=comp_expr(true,false);
                        if pt.nodetype=stringconstn then
                          hpname:=strpas(tstringconstnode(pt).value_str)
+                       else if is_constcharnode(pt) then
+                         hpname:=chr(tordconstnode(pt).value.svalue and $ff)
                        else
                          consume(_CSTRING);
                        options:=options or eo_name;

+ 11 - 0
tests/tbs/tb0582.pp

@@ -0,0 +1,11 @@
+{ %norun }
+library liba;
+
+function A : integer;
+
+begin
+end;
+
+exports
+   A name 'c';
+end.